On 10/26/07, Hugh Bien <[EMAIL PROTECTED]> wrote:
> I haven't really used generic views that often, but I know you could always
> extend them by creating your own views.
>
> Inside your views.py:
>
>
> from django.views.generic.list_detail import object_list
>
> @login_required
> def my_list(*args, **kwargs):
>     return object_list(*args, **kwargs)

Or even just:

from django.views.generic.list_detail import object_list
from django.contrib.auth.decorators import login_required

my_list = login_required(object_list)

And now my_list is a login-protected version of object_list. This is
also more compatible with older versions of Python, in case the app is
ever distributed.

Also note that this can be done either in views.py, or directly in
urls.py. It's your call.

-Gul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to