mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed inaccuracies in generic mixins documentation.
This commit is contained in:
parent
98dd8dd02e
commit
a5391db76a
2 changed files with 17 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue