Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clouds = Cloud.objects.filter(pk__in=pk_set)
- projects = structure_models.Project.objects.filter(pk__in=pk_set)
- if action == 'post_add':
- if reverse:
- for added_cloud in clouds.iterator():
- marry_cloud_to_project(added_cloud, instance)
- else:
- for added_project in projects.iterator():
- marry_cloud_to_project(instance, added_project)
- elif action == 'pre_remove':
- if reverse:
- for added_cloud in clouds.iterator():
- divorce_cloud_from_project(added_cloud, instance)
- else:
- for added_project in projects.iterator():
- divorce_cloud_from_project(instance, added_project)
- elif action == 'pre_clear':
- if reverse:
- for added_cloud in instance.clouds.iterator():
- divorce_cloud_from_project(added_cloud, instance)
- else:
- for added_project in instance.projects.iterator():
- divorce_cloud_from_project(instance, added_project)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement