What's the difference between django.views.generic.ListView and django.views.generic.list_detail?

36 views
Skip to first unread message

Dae_James

unread,
Nov 21, 2012, 12:32:15 AM11/21/12
to django...@googlegroups.com
What's the difference between django.views.generic.ListView and django.views.generic.list_detail?

I think the two have same function. Only the usage of them are different. Why do both of them exist?

Ankur Sethi

unread,
Nov 21, 2012, 1:38:19 AM11/21/12
to django...@googlegroups.com
On Wed, Nov 21, 2012 at 11:02 AM, Dae_James <daed...@126.com> wrote:
What's the difference between django.views.generic.ListView and django.views.generic.list_detail?

I think the two have same function. Only the usage of them are different. Why do both of them exist?

The django.views.generic.list_detail module contains a number of function-based generic views (object_detail, object_list), which used to be how generic views were done in Django prior to (IIRC) Django 1.3. On the other hand, django.views.generic.ListView is a class-based generic view, introduced in Django 1.3 (again IIRC).

In newer versions of Django, function-based generic views have been deprecated in favor of class-based views.

Does that answer your question?

Dae James

unread,
Nov 21, 2012, 10:53:23 PM11/21/12
to django-users
Yes, thank you very much. I got it.
 

Dae James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply all
Reply to author
Forward
0 new messages