mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #14141: docs now use the :doc: construct for links between documents.
Thanks, Ramiro Morales. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
.. _topics-forms-formsets:
|
||||
.. _formsets:
|
||||
|
||||
Formsets
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
.. _topics-forms-index:
|
||||
|
||||
==================
|
||||
Working with forms
|
||||
==================
|
||||
@@ -7,8 +5,8 @@ Working with forms
|
||||
.. admonition:: About this document
|
||||
|
||||
This document provides an introduction to Django's form handling features.
|
||||
For a more detailed look at the forms API, see :ref:`ref-forms-api`. For
|
||||
documentation of the available field types, see :ref:`ref-forms-fields`.
|
||||
For a more detailed look at the forms API, see :doc:`/ref/forms/api`. For
|
||||
documentation of the available field types, see :doc:`/ref/forms/fields`.
|
||||
|
||||
.. highlightlang:: html+django
|
||||
|
||||
@@ -77,10 +75,10 @@ personal Web site:
|
||||
A form is composed of ``Field`` objects. In this case, our form has four
|
||||
fields: ``subject``, ``message``, ``sender`` and ``cc_myself``. ``CharField``,
|
||||
``EmailField`` and ``BooleanField`` are just three of the available field types;
|
||||
a full list can be found in :ref:`ref-forms-fields`.
|
||||
a full list can be found in :doc:`/ref/forms/fields`.
|
||||
|
||||
If your form is going to be used to directly add or edit a Django model, you can
|
||||
use a :ref:`ModelForm <topics-forms-modelforms>` to avoid duplicating your model
|
||||
use a :doc:`ModelForm </topics/forms/modelforms>` to avoid duplicating your model
|
||||
description.
|
||||
|
||||
Using a form in a view
|
||||
@@ -163,7 +161,7 @@ Extending the above example, here's how the form data could be processed:
|
||||
send_mail(subject, message, sender, recipients)
|
||||
return HttpResponseRedirect('/thanks/') # Redirect after POST
|
||||
|
||||
For more on sending e-mail from Django, see :ref:`topics-email`.
|
||||
For more on sending e-mail from Django, see :doc:`/topics/email`.
|
||||
|
||||
Displaying a form using a template
|
||||
----------------------------------
|
||||
@@ -397,4 +395,4 @@ This covers the basics, but forms can do a whole lot more:
|
||||
|
||||
.. seealso::
|
||||
|
||||
The :ref:`form API reference <ref-forms-index>`.
|
||||
The :doc:`form API reference </ref/forms/index>`.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
.. _topics-forms-media:
|
||||
|
||||
Form Media
|
||||
==========
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
.. _topics-forms-modelforms:
|
||||
|
||||
==========================
|
||||
Creating forms from models
|
||||
==========================
|
||||
@@ -446,7 +444,7 @@ parameter when declaring the form field::
|
||||
class Meta:
|
||||
model = Article
|
||||
|
||||
See the :ref:`form field documentation <ref-forms-fields>` for more information
|
||||
See the :doc:`form field documentation </ref/forms/fields>` for more information
|
||||
on fields and their arguments.
|
||||
|
||||
Changing the order of fields
|
||||
@@ -540,7 +538,7 @@ Interaction with model validation
|
||||
As part of its validation process, ``ModelForm`` will call the ``clean()``
|
||||
method of each field on your model that has a corresponding field on your form.
|
||||
If you have excluded any model fields, validation will not be run on those
|
||||
fields. See the :ref:`form validation <ref-forms-validation>` documentation
|
||||
fields. See the :doc:`form validation </ref/forms/validation>` documentation
|
||||
for more on how field cleaning and validation work. Also, your model's
|
||||
``clean()`` method will be called before any uniqueness checks are made. See
|
||||
:ref:`Validating objects <validating-objects>` for more information on the
|
||||
@@ -551,7 +549,7 @@ model's ``clean()`` hook.
|
||||
Model formsets
|
||||
==============
|
||||
|
||||
Like :ref:`regular formsets <topics-forms-formsets>`, Django provides a couple
|
||||
Like :doc:`regular formsets </topics/forms/formsets>`, Django provides a couple
|
||||
of enhanced formset classes that make it easy to work with Django models. Let's
|
||||
reuse the ``Author`` model from above::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user