Skip to content

Instantly share code, notes, and snippets.

@rootisenabled
Created November 2, 2022 12:04
Show Gist options
  • Save rootisenabled/1815a072cd804d1de4320ccf2eb7ea87 to your computer and use it in GitHub Desktop.
Save rootisenabled/1815a072cd804d1de4320ccf2eb7ea87 to your computer and use it in GitHub Desktop.
from cloud.mountingsurface.models import MountingSurface
from cloud.businessunits.models import BusinessUnit
bu_copy_from = BusinessUnit.objects.get(slug='otovo-nl')
bu_copy_to = BusinessUnit.objects.get(slug='otovo-be')
ms = MountingSurface.get_valid_choices_by_business_unit(bu_copy_from)
for m in ms:
m.pk = None
m.business_unit = bu_copy_to
m.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment