blob: 72f76fae3f7c8ef0233e827afb2aaf83a553de56 [file] [log] [blame]
Sapan Bhatia39c3a702015-01-23 16:11:51 +00001def handle(image):
2 from core.models import Controller, ControllerImages, Image
3 from collections import defaultdict
4
5 controller_images = ControllerImages.objects.filter(image=image)
6 existing_controllers = [cs.controller for cs in controller_images]
7
8 all_controllers = Controller.objects.all()
9 for controller in all_controllers:
10 if controller not in existing_controllers:
11 sd = ControllerImages(image=image, controller=controller)
12 sd.save()
13