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.context_object_name

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

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.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.edit.UpdateView.template_name_suffix

template_name_suffix The UpdateView page displayed to a GET request uses a template_name_suffix of '_form'. For example, changing this attribute to '_update_form' for a view updating objects for the example Author model would cause the default template_name to be 'myapp/author_update_form.html'.

views.generic.list.BaseListView.get()

get(request, *args, **kwargs) Adds object_list to the context. If allow_empty is True then display an empty list. If allow_empty is False then raise a 404 error.

views.generic.list.BaseListView

class django.views.generic.list.BaseListView A base view for displaying a list of objects. It is not intended to be used directly, but rather as a parent class of the django.views.generic.list.ListView or other views representing lists of objects. Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.list.MultipleObjectMixin django.views.generic.base.View Methods get(request, *args, **kwargs) Adds object_list to the context. If allow_em

views.generic.edit.UpdateView.object

object When using UpdateView you have access to self.object, which is the object being updated. Example myapp/views.py: from django.views.generic.edit import UpdateView from myapp.models import Author class AuthorUpdate(UpdateView): model = Author fields = ['name'] template_name_suffix = '_update_form' Example myapp/author_update_form.html: <form action="" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="Update" /> </form>

views.generic.edit.UpdateView

class django.views.generic.edit.UpdateView A view that displays a form for editing an existing object, redisplaying the form with validation errors (if there are any) and saving changes to the object. This uses a form automatically generated from the object’s model class (unless a form class is manually specified). Ancestors (MRO) This view inherits methods and attributes from the following views: django.views.generic.detail.SingleObjectTemplateResponseMixin django.views.generic.base.Templat

views.generic.edit.ProcessFormView

class django.views.generic.edit.ProcessFormView A mixin that provides basic HTTP GET and POST workflow. Note This is named ‘ProcessFormView’ and inherits directly from django.views.generic.base.View, but breaks if used independently, so it is more of a mixin. Extends django.views.generic.base.View Methods and Attributes get(request, *args, **kwargs) Renders a response using a context created with get_context_data(). Changed in Django 1.9: Construction of the form was moved from this