Fixed inaccuracies in generic mixins documentation.

This commit is contained in:
Baptiste Mispelon 2014-02-09 10:50:09 +00:00
parent 98dd8dd02e
commit a5391db76a
2 changed files with 17 additions and 4 deletions

View file

@ -111,6 +111,12 @@ CreateView
creating objects for the example ``Author`` model would cause the
default ``template_name`` to be ``'myapp/author_create_form.html'``.
.. attribute:: object
When using ``CreateView`` you have access to ``self.object``, which is
the object being created. If the object hasn't been created yet, the
value will be ``None``.
**Example myapp/views.py**::
from django.views.generic.edit import CreateView
@ -162,6 +168,11 @@ UpdateView
updating objects for the example ``Author`` model would cause the
default ``template_name`` to be ``'myapp/author_update_form.html'``.
.. attribute:: 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