All of my work from commits: dd4a194, 692644a, 4a60203, 5de46bc, 152042d, 64a2d4e...
[philo.git] / admin / forms / containers.py
index 181a3e7..420ba17 100644 (file)
@@ -169,19 +169,19 @@ class ContentletInlineFormSet(ContainerInlineFormSet):
 class ContentReferenceInlineFormSet(ContainerInlineFormSet):
        def get_containers(self):
                try:
 class ContentReferenceInlineFormSet(ContainerInlineFormSet):
        def get_containers(self):
                try:
-                       containers = list(self.instance.containers[1])
+                       containers = self.instance.containers[1]
                except ObjectDoesNotExist:
                except ObjectDoesNotExist:
-                       containers = []
+                       containers = {}
                
                filter = Q()
                
                filter = Q()
-               for name, ct in containers:
+               for name, ct in containers.items():
                        filter |= Q(name=name, content_type=ct)
                qs = self.get_queryset().filter(filter)
                
                container_dict = SortedDict([(container.name, container) for container in qs])
                
                keyOrder = []
                        filter |= Q(name=name, content_type=ct)
                qs = self.get_queryset().filter(filter)
                
                container_dict = SortedDict([(container.name, container) for container in qs])
                
                keyOrder = []
-               for name, ct in containers:
+               for name, ct in containers.items():
                        keyOrder.append(name)
                        if name not in container_dict:
                                container_dict[name] = self.model(name=name, content_type=ct)
                        keyOrder.append(name)
                        if name not in container_dict:
                                container_dict[name] = self.model(name=name, content_type=ct)