Django for Designers: Difference between revisions

imported>Paulproteus
(→‎Curriculum: Add part 5 link)
Line 664:
</source>
 
We also want our tag view to show real bookmarks. We only want to show bookmarks that have been tagged with the given tag. So we'll edit the import statement we just added:
 
<source lang="python">
from django.shortcuts import render
from bookmarks.models import Bookmark, Tag
</source>
 
And alter the tag() definition as well:
 
<source lang="python">
[...]
 
def tag(request, tag_name):
tag = Tag.objects.get(slug=tag_name)
Anonymous user