Anonymous user
Django for Designers: Difference between revisions
→Get views.py to talk to our models
imported>Paulproteus (→Part 2: URLs, basic views, templates, static files: Removed, by moving it to a new page) |
|||
Line 632:
Then, we'll need to have our views.py file import the bookmark model and send data to the index view.
We'll add an import statement:
<source lang="python">
from bookmarks.models import Bookmark
</source>
And we'll edit index(request):
<source lang="python">
def index(request):
bookmarks = Bookmark.objects.all()
Line 659 ⟶ 663:
</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.
<source lang="python">
|