November 2015
Beginner to intermediate
840 pages
26h 30m
English
tag_detail() Function ViewOpen /organizer/views.py and program the bare minimum functionality of a view (accept an HttpRequest object, return an HttpResponse object), as shown in Example 5.5.
Example 5.5: Project Code
organizer/views.py in f0d1985791
16 def tag_detail(request): 17 return HttpResponse()
Our first task is to select the data for the Tag object that the user has selected. For the moment, we will assume that we have somehow been passed the unique slug value of the Tag as the variable slug, and we use it in our code (but Python will yell at you if you try to run this). We use the get() method of our Tag model manager, which returns a single object. We want our search for the ...
Read now
Unlock full access