views.generic.list.ListView

class django.views.generic.list.ListView A page representing a list of objects. While this view is executing, self.object_list will contain the list of objects (usually, but not necessarily a queryset) that the view is operating upon. Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.list.MultipleObjectTemplateResponseMixin django.views.generic.base.TemplateResponseMixin django.views.generic.list.BaseListView django.views.generic.list.Mu

views.generic.list.MultipleObjectMixin

class django.views.generic.list.MultipleObjectMixin A mixin that can be used to display a list of objects. If paginate_by is specified, Django will paginate the results returned by this. You can specify the page number in the URL in one of two ways: Use the page parameter in the URLconf. For example, this is what your URLconf might look like: url(r'^objects/page(?P<page>[0-9]+)/$', PaginatedView.as_view()), Pass the page number via the page query-string parameter. For example, a UR

views.generic.list.MultipleObjectMixin.allow_empty

allow_empty A boolean specifying whether to display the page if no objects are available. If this is False and no objects are available, the view will raise a 404 instead of displaying an empty page. By default, this is True.

views.generic.list.MultipleObjectMixin.context_object_name

context_object_name Designates the name of the variable to use in the context.

views.generic.list.MultipleObjectMixin.get_allow_empty()

get_allow_empty() Return a boolean specifying whether to display the page if no objects are available. If this method returns False and no objects are available, the view will raise a 404 instead of displaying an empty page. By default, this is True.

views.generic.list.MultipleObjectMixin.get_context_data()

get_context_data(**kwargs) Returns context data for displaying the list of objects. Context object_list: The list of objects that this view is displaying. If context_object_name is specified, that variable will also be set in the context, with the same value as object_list. is_paginated: A boolean representing whether the results are paginated. Specifically, this is set to False if no page size has been specified, or if the available objects do not span multiple pages. paginator: An insta

views.generic.list.MultipleObjectMixin.get_context_object_name()

get_context_object_name(object_list) Return the context variable name that will be used to contain the list of data that this view is manipulating. If object_list is a queryset of Django objects and context_object_name is not set, the context name will be the model_name of the model that the queryset is composed from, with postfix '_list' appended. For example, the model Article would have a context object named article_list.

views.generic.list.MultipleObjectMixin.get_ordering()

get_ordering() Returns a string (or iterable of strings) that defines the ordering that will be applied to the queryset. Returns ordering by default.

views.generic.list.MultipleObjectMixin.get_paginate_by()

get_paginate_by(queryset) Returns the number of items to paginate by, or None for no pagination. By default this simply returns the value of paginate_by.

views.generic.list.MultipleObjectMixin.get_paginate_orphans()

get_paginate_orphans() An integer specifying the number of “overflow” objects the last page can contain. By default this simply returns the value of paginate_orphans.