Kaydet (Commit) 6cd8e0f6 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Added versionadded markers for ModelForm field ordering, added in [10062].

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10144 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 214c7921
...@@ -259,8 +259,12 @@ model fields: ...@@ -259,8 +259,12 @@ model fields:
2. Use the ``fields`` attribute of the ``ModelForm``'s inner ``Meta`` 2. Use the ``fields`` attribute of the ``ModelForm``'s inner ``Meta``
class. This attribute, if given, should be a list of field names class. This attribute, if given, should be a list of field names
to include in the form. The form will render the fields in the same to include in the form.
order they are specified in the ``fields`` attribute.
.. versionchanged:: 1.1
The form will render the fields in the same order they are specified in the
``fields`` attribute.
3. Use the ``exclude`` attribute of the ``ModelForm``'s inner ``Meta`` 3. Use the ``exclude`` attribute of the ``ModelForm``'s inner ``Meta``
class. This attribute, if given, should be a list of field names class. This attribute, if given, should be a list of field names
...@@ -340,6 +344,8 @@ parameter when declaring the form field:: ...@@ -340,6 +344,8 @@ parameter when declaring the form field::
Changing the order of fields Changing the order of fields
---------------------------- ----------------------------
.. versionadded:: 1.1
By default, a ``ModelForm`` will render fields in the same order that they are By default, a ``ModelForm`` will render fields in the same order that they are
defined on the model, with ``ManyToManyField`` instances appearing last. If defined on the model, with ``ManyToManyField`` instances appearing last. If
you want to change the order in which fields are rendered, you can use the you want to change the order in which fields are rendered, you can use the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment