Removed template container discovery in favor of (potentially) larger queries.
authorStephen Burrows <stephen.r.burrows@gmail.com>
Mon, 27 Jun 2011 16:27:02 +0000 (12:27 -0400)
committerStephen Burrows <stephen.r.burrows@gmail.com>
Mon, 27 Jun 2011 16:27:02 +0000 (12:27 -0400)
philo/templatetags/containers.py

index 11ccd88..c9ef2a0 100644 (file)
@@ -47,12 +47,8 @@ class ContainerNode(template.Node):
                        except KeyError:
                                return settings.TEMPLATE_STRING_IF_INVALID
                        
                        except KeyError:
                                return settings.TEMPLATE_STRING_IF_INVALID
                        
-                       contentlet_specs, contentreference_specs = page.template.containers
-                       contentlets = page.contentlets.filter(name__in=contentlet_specs)
-                       q = Q()
-                       for name, ct in contentreference_specs.items():
-                               q |= Q(name=name, content_type=ct)
-                       references = page.contentreferences.filter(q)
+                       contentlets = page.contentlets.all()
+                       references = page.contentreferences.all()
                        
                        container_context = ContainerContext(contentlets, references)
                        context.render_context[CONTAINER_CONTEXT_KEY] = container_context
                        
                        container_context = ContainerContext(contentlets, references)
                        context.render_context[CONTAINER_CONTEXT_KEY] = container_context