from django.views.generic import ListView
-----------------------------------
class ListView Found at: django.views.generic.list
class ListView(MultipleObjectTemplateResponseMixin, BaseListView):
"""
Render some list of objects, set by `self.model` or `self.queryset`.
`self.queryset` can actually be any iterable of items, not just a queryset.
"""
from django.views.generic import DetailView
-------------------------------------------
class DetailView Found at: django.views.generic.detail
class DetailView(SingleObjectTemplateResponseMixin, BaseDetailView):
"""
Render a "detail" view of an object.
By default this is a model instance looked up from `self.queryset`, but the
view will support display of *any* object by overriding `self.get_object()`.
"""
from django.views.generic.edit import CreateView
------------------------------------------------
class CreateView Found at: django.views.generic.edit
class CreateView(SingleObjectTemplateResponseMixin, BaseCreateView):
"""
View for creating a new object instance,
with a response rendered by template.
"""
template_name_suffix = ‘_form‘
from django.views.generic.edit import UpdateView
------------------------------------------------
class UpdateView Found at: django.views.generic.edit
class UpdateView(SingleObjectTemplateResponseMixin, BaseUpdateView):
"""
View for updating an object,
with a response rendered by template.
"""
template_name_suffix = ‘_form‘
from django.views.generic.edit import DeleteView
------------------------------------------------
class DeleteView Found at: django.views.generic.edit
class DeleteView(SingleObjectTemplateResponseMixin, BaseDeleteView):
"""
View for deleting an object retrieved with `self.get_object()`,
with a response rendered by template.
"""
template_name_suffix = ‘_confirm_delete‘
from django.views.generic.edit import FormView
----------------------------------------------
class FormView Found at: django.views.generic.edit
class FormView(TemplateResponseMixin, BaseFormView):
"""
A view for displaying a form, and rendering a template response.
"""
原文地址:http://blog.csdn.net/tmpbook/article/details/45169741