~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/ref/generic-views.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (4.4.9 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-5rk3p18nyanuhj6g
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _ref-generic-views:
2
 
 
3
1
=============
4
2
Generic views
5
3
=============
9
7
abstracted into "generic views" that let you quickly provide common views of
10
8
an object without actually needing to write any Python code.
11
9
 
12
 
A general introduction to generic views can be found in the :ref:`topic guide
13
 
<topics-generic-views>`.
 
10
A general introduction to generic views can be found in the :doc:`topic guide
 
11
</topics/http/generic-views>`.
14
12
 
15
13
This reference contains details of Django's built-in generic views, along with
16
14
a list of all keyword arguments that a generic view expects. Remember that
18
16
additional-information dictionary.
19
17
 
20
18
Most generic views require the ``queryset`` key, which is a ``QuerySet``
21
 
instance; see :ref:`topics-db-queries` for more information about ``QuerySet``
 
19
instance; see :doc:`/topics/db/queries` for more information about ``QuerySet``
22
20
objects.
23
21
 
24
22
"Simple" generic views
766
764
These values and lists are 1-based, not 0-based, so the first page would be
767
765
represented as page ``1``.
768
766
 
769
 
For more on pagination, read the :ref:`pagination documentation
770
 
<topics-pagination>`.
 
767
For more on pagination, read the :doc:`pagination documentation
 
768
</topics/pagination>`.
771
769
 
772
770
.. versionadded:: 1.0
773
771
 
858
856
.. versionchanged:: 1.0
859
857
 
860
858
``django.views.generic.create_update.create_object`` and
861
 
``django.views.generic.create_update.update_object`` now use the new :ref:`forms
862
 
library <topics-forms-index>` to build and display the form.
 
859
``django.views.generic.create_update.update_object`` now use the new :doc:`forms
 
860
library </topics/forms/index>` to build and display the form.
863
861
 
864
862
``django.views.generic.create_update.create_object``
865
863
----------------------------------------------------
875
873
 
876
874
      If you provide ``form_class``, it should be a ``django.forms.ModelForm``
877
875
      subclass. Use this argument when you need to customize the model's form.
878
 
      See the :ref:`ModelForm docs <topics-forms-modelforms>` for more
 
876
      See the :doc:`ModelForm docs </topics/forms/modelforms>` for more
879
877
      information.
880
878
 
881
879
      Otherwise, ``model`` should be a Django model class and the form used
892
890
 
893
891
    * ``login_required``: A boolean that designates whether a user must be
894
892
      logged in, in order to see the page and save changes. This hooks into the
895
 
      Django :ref:`authentication system <topics-auth>`. By default, this is
 
893
      Django :doc:`authentication system </topics/auth>`. By default, this is
896
894
      ``False``.
897
895
 
898
896
      If this is ``True``, and a non-logged-in user attempts to visit this page
932
930
          <p>{{ form.address.label_tag }} {{ form.address }}</p>
933
931
          </form>
934
932
 
935
 
      See the :ref:`forms documentation <topics-forms-index>` for more
 
933
      See the :doc:`forms documentation </topics/forms/index>` for more
936
934
      information about using ``Form`` objects in templates.
937
935
 
938
936
``django.views.generic.create_update.update_object``
951
949
 
952
950
      If you provide ``form_class``, it should be a ``django.forms.ModelForm``
953
951
      subclass. Use this argument when you need to customize the model's form.
954
 
      See the :ref:`ModelForm docs <topics-forms-modelforms>` for more
 
952
      See the :doc:`ModelForm docs </topics/forms/modelforms>` for more
955
953
      information.
956
954
 
957
955
      Otherwise, ``model`` should be a Django model class and the form used
977
975
 
978
976
    * ``login_required``: A boolean that designates whether a user must be
979
977
      logged in, in order to see the page and save changes. This hooks into the
980
 
      Django :ref:`authentication system <topics-auth>`. By default, this is
 
978
      Django :doc:`authentication system </topics/auth>`. By default, this is
981
979
      ``False``.
982
980
 
983
981
      If this is ``True``, and a non-logged-in user attempts to visit this page
1020
1018
          <p>{{ form.address.label_tag }} {{ form.address }}</p>
1021
1019
          </form>
1022
1020
 
1023
 
      See the :ref:`forms documentation <topics-forms-index>` for more
 
1021
      See the :doc:`forms documentation </topics/forms/index>` for more
1024
1022
      information about using ``Form`` objects in templates.
1025
1023
 
1026
1024
    * ``object``: The original object being edited. This variable's name
1059
1057
 
1060
1058
    * ``login_required``: A boolean that designates whether a user must be
1061
1059
      logged in, in order to see the page and save changes. This hooks into the
1062
 
      Django :ref:`authentication system <topics-auth>`. By default, this is
 
1060
      Django :doc:`authentication system </topics/auth>`. By default, this is
1063
1061
      ``False``.
1064
1062
 
1065
1063
      If this is ``True``, and a non-logged-in user attempts to visit this page