mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-05 23:50:59 +00:00
Merge pull request #734 from edrex/patch-1
docs: fix code sample indentation
This commit is contained in:
commit
cc2af2f4e2
1 changed files with 4 additions and 4 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue