From b89f6ce00c7e0e328e265151cffdbd7e7d9b3634 Mon Sep 17 00:00:00 2001 From: Eric Drechsel Date: Wed, 22 Oct 2014 11:25:18 -0700 Subject: [PATCH] fix code sample indentation --- docs/core_components/pages/model_recipes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/core_components/pages/model_recipes.rst b/docs/core_components/pages/model_recipes.rst index 4b0574ba2..bece7919e 100644 --- a/docs/core_components/pages/model_recipes.rst +++ b/docs/core_components/pages/model_recipes.rst @@ -179,10 +179,10 @@ Now that we have the many-to-many tag relationship in place, we can fit in a way if tag: blogs = blogs.filter(tags__name=tag) - return render(request, self.template, { - 'self': self, - 'blogs': blogs, - }) + return render(request, self.template, { + 'self': self, + 'blogs': blogs, + }) Here, ``blogs.filter(tags__name=tag)`` invokes a reverse Django queryset filter on the ``BlogPageTag`` model to optionally limit the ``BlogPage`` objects sent to the template for rendering. Now, lets render both sides of the relation by showing the tags associated with an object and a way of showing all of the objects associated with each tag. This could be added to the ``blog_page.html`` template: