OMG! UBUNTU!: Desktop Map Viewer "Emerillion" For Ubuntu - 0 views
senduit | Share easily. - 1 views
OMG! UBUNTU!: Watch YouTube Video's Without Flash In Your Browser! - 0 views
FacteryLabs Homepage - 0 views
COI usability toolkit - 0 views
Chapter 11: Generic Views - 0 views
-
from django.conf.urls.defaults import * from django.views.generic import list_detail from mysite.books.models import Publisher publisher_info = { 'queryset': Publisher.objects.all(), 'template_name': 'publisher_list_page.html', } urlpatterns = patterns('', (r'^publishers/$', list_detail.object_list, publisher_info) )
-
That’s really all there is to it. All the cool features of generic views come from changing the “info” dictionary passed to the generic view.
-
You might have noticed that sample publisher list template stores all the books in a variable named object_list.
- ...10 more annotations...
Chapter 8: Advanced Views and URLconfs - 0 views
-
Here, each view starts by checking that request.user is authenticated — that is, the current user has successfully logged into the site — and redirects to /accounts/login/ if not.
-
It would be nice if we could remove that bit of repetitive code from each of these views and just mark them as requiring authentication.
-
Now, we can remove the if not request.user.is_authenticated() checks from our views and simply wrap them with requires_login in our URLconf:
- ...3 more annotations...
« First
‹ Previous
81 - 100
Next ›
Last »
Showing 20▼ items per page