mirror of https://github.com/django/django.git
[1.5.x] Added links to default widget in forms.fields documentation
Backport of 2d0b35d2bb
from master.
This commit is contained in:
parent
5097d3c5fa
commit
0c96aae700
|
@ -289,7 +289,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: BooleanField(**kwargs)
|
.. class:: BooleanField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``CheckboxInput``
|
* Default widget: :class:`CheckboxInput`
|
||||||
* Empty value: ``False``
|
* Empty value: ``False``
|
||||||
* Normalizes to: A Python ``True`` or ``False`` value.
|
* Normalizes to: A Python ``True`` or ``False`` value.
|
||||||
* Validates that the value is ``True`` (e.g. the check box is checked) if
|
* Validates that the value is ``True`` (e.g. the check box is checked) if
|
||||||
|
@ -309,7 +309,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: CharField(**kwargs)
|
.. class:: CharField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates ``max_length`` or ``min_length``, if they are provided.
|
* Validates ``max_length`` or ``min_length``, if they are provided.
|
||||||
|
@ -329,7 +329,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: ChoiceField(**kwargs)
|
.. class:: ChoiceField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``Select``
|
* Default widget: :class:`Select`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value exists in the list of choices.
|
* Validates that the given value exists in the list of choices.
|
||||||
|
@ -355,7 +355,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
Just like a :class:`ChoiceField`, except :class:`TypedChoiceField` takes two
|
Just like a :class:`ChoiceField`, except :class:`TypedChoiceField` takes two
|
||||||
extra arguments, ``coerce`` and ``empty_value``.
|
extra arguments, ``coerce`` and ``empty_value``.
|
||||||
|
|
||||||
* Default widget: ``Select``
|
* Default widget: :class:`Select`
|
||||||
* Empty value: Whatever you've given as ``empty_value``
|
* Empty value: Whatever you've given as ``empty_value``
|
||||||
* Normalizes to: A value of the type provided by the ``coerce`` argument.
|
* Normalizes to: A value of the type provided by the ``coerce`` argument.
|
||||||
* Validates that the given value exists in the list of choices and can be
|
* Validates that the given value exists in the list of choices and can be
|
||||||
|
@ -382,7 +382,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: DateField(**kwargs)
|
.. class:: DateField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``DateInput``
|
* Default widget: :class:`DateInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``datetime.date`` object.
|
* Normalizes to: A Python ``datetime.date`` object.
|
||||||
* Validates that the given value is either a ``datetime.date``,
|
* Validates that the given value is either a ``datetime.date``,
|
||||||
|
@ -421,7 +421,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: DateTimeField(**kwargs)
|
.. class:: DateTimeField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``DateTimeInput``
|
* Default widget: :class:`DateTimeInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``datetime.datetime`` object.
|
* Normalizes to: A Python ``datetime.datetime`` object.
|
||||||
* Validates that the given value is either a ``datetime.datetime``,
|
* Validates that the given value is either a ``datetime.datetime``,
|
||||||
|
@ -454,7 +454,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: DecimalField(**kwargs)
|
.. class:: DecimalField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``decimal``.
|
* Normalizes to: A Python ``decimal``.
|
||||||
* Validates that the given value is a decimal. Leading and trailing
|
* Validates that the given value is a decimal. Leading and trailing
|
||||||
|
@ -489,7 +489,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: EmailField(**kwargs)
|
.. class:: EmailField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value is a valid email address, using a
|
* Validates that the given value is a valid email address, using a
|
||||||
|
@ -505,7 +505,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: FileField(**kwargs)
|
.. class:: FileField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``ClearableFileInput``
|
* Default widget: :class:`ClearableFileInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
||||||
and file name into a single object.
|
and file name into a single object.
|
||||||
|
@ -533,7 +533,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: FilePathField(**kwargs)
|
.. class:: FilePathField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``Select``
|
* Default widget: :class:`Select`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A unicode object
|
* Normalizes to: A unicode object
|
||||||
* Validates that the selected choice exists in the list of choices.
|
* Validates that the selected choice exists in the list of choices.
|
||||||
|
@ -580,7 +580,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: FloatField(**kwargs)
|
.. class:: FloatField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python float.
|
* Normalizes to: A Python float.
|
||||||
* Validates that the given value is an float. Leading and trailing
|
* Validates that the given value is an float. Leading and trailing
|
||||||
|
@ -596,7 +596,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: ImageField(**kwargs)
|
.. class:: ImageField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``ClearableFileInput``
|
* Default widget: :class:`ClearableFileInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
* Normalizes to: An ``UploadedFile`` object that wraps the file content
|
||||||
and file name into a single object.
|
and file name into a single object.
|
||||||
|
@ -621,7 +621,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: IntegerField(**kwargs)
|
.. class:: IntegerField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python integer or long integer.
|
* Normalizes to: A Python integer or long integer.
|
||||||
* Validates that the given value is an integer. Leading and trailing
|
* Validates that the given value is an integer. Leading and trailing
|
||||||
|
@ -644,7 +644,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: IPAddressField(**kwargs)
|
.. class:: IPAddressField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value is a valid IPv4 address, using a regular
|
* Validates that the given value is a valid IPv4 address, using a regular
|
||||||
|
@ -660,7 +660,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
A field containing either an IPv4 or an IPv6 address.
|
A field containing either an IPv4 or an IPv6 address.
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object. IPv6 addresses are
|
* Normalizes to: A Unicode object. IPv6 addresses are
|
||||||
normalized as described below.
|
normalized as described below.
|
||||||
|
@ -693,7 +693,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: MultipleChoiceField(**kwargs)
|
.. class:: MultipleChoiceField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``SelectMultiple``
|
* Default widget: :class:`SelectMultiple`
|
||||||
* Empty value: ``[]`` (an empty list)
|
* Empty value: ``[]`` (an empty list)
|
||||||
* Normalizes to: A list of Unicode objects.
|
* Normalizes to: A list of Unicode objects.
|
||||||
* Validates that every value in the given list of values exists in the list
|
* Validates that every value in the given list of values exists in the list
|
||||||
|
@ -713,7 +713,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
Just like a :class:`MultipleChoiceField`, except :class:`TypedMultipleChoiceField`
|
Just like a :class:`MultipleChoiceField`, except :class:`TypedMultipleChoiceField`
|
||||||
takes two extra arguments, ``coerce`` and ``empty_value``.
|
takes two extra arguments, ``coerce`` and ``empty_value``.
|
||||||
|
|
||||||
* Default widget: ``SelectMultiple``
|
* Default widget: :class:`SelectMultiple`
|
||||||
* Empty value: Whatever you've given as ``empty_value``
|
* Empty value: Whatever you've given as ``empty_value``
|
||||||
* Normalizes to: A list of values of the type provided by the ``coerce``
|
* Normalizes to: A list of values of the type provided by the ``coerce``
|
||||||
argument.
|
argument.
|
||||||
|
@ -731,7 +731,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: NullBooleanField(**kwargs)
|
.. class:: NullBooleanField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``NullBooleanSelect``
|
* Default widget: :class:`NullBooleanSelect`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``True``, ``False`` or ``None`` value.
|
* Normalizes to: A Python ``True``, ``False`` or ``None`` value.
|
||||||
* Validates nothing (i.e., it never raises a ``ValidationError``).
|
* Validates nothing (i.e., it never raises a ``ValidationError``).
|
||||||
|
@ -741,7 +741,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: RegexField(**kwargs)
|
.. class:: RegexField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value matches against a certain regular
|
* Validates that the given value matches against a certain regular
|
||||||
|
@ -768,7 +768,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: SlugField(**kwargs)
|
.. class:: SlugField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value contains only letters, numbers,
|
* Validates that the given value contains only letters, numbers,
|
||||||
|
@ -783,7 +783,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: TimeField(**kwargs)
|
.. class:: TimeField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``datetime.time`` object.
|
* Normalizes to: A Python ``datetime.time`` object.
|
||||||
* Validates that the given value is either a ``datetime.time`` or string
|
* Validates that the given value is either a ``datetime.time`` or string
|
||||||
|
@ -807,7 +807,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
|
|
||||||
.. class:: URLField(**kwargs)
|
.. class:: URLField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value is a valid URL.
|
* Validates that the given value is a valid URL.
|
||||||
|
@ -829,7 +829,7 @@ Slightly complex built-in ``Field`` classes
|
||||||
|
|
||||||
.. class:: ComboField(**kwargs)
|
.. class:: ComboField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: A Unicode object.
|
* Normalizes to: A Unicode object.
|
||||||
* Validates that the given value against each of the fields specified
|
* Validates that the given value against each of the fields specified
|
||||||
|
@ -856,7 +856,7 @@ Slightly complex built-in ``Field`` classes
|
||||||
|
|
||||||
.. class:: MultiValueField(fields=(), **kwargs)
|
.. class:: MultiValueField(fields=(), **kwargs)
|
||||||
|
|
||||||
* Default widget: ``TextInput``
|
* Default widget: :class:`TextInput`
|
||||||
* Empty value: ``''`` (an empty string)
|
* Empty value: ``''`` (an empty string)
|
||||||
* Normalizes to: the type returned by the ``compress`` method of the subclass.
|
* Normalizes to: the type returned by the ``compress`` method of the subclass.
|
||||||
* Validates that the given value against each of the fields specified
|
* Validates that the given value against each of the fields specified
|
||||||
|
@ -902,7 +902,7 @@ Slightly complex built-in ``Field`` classes
|
||||||
|
|
||||||
.. class:: SplitDateTimeField(**kwargs)
|
.. class:: SplitDateTimeField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``SplitDateTimeWidget``
|
* Default widget: :class:`SplitDateTimeWidget`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A Python ``datetime.datetime`` object.
|
* Normalizes to: A Python ``datetime.datetime`` object.
|
||||||
* Validates that the given value is a ``datetime.datetime`` or string
|
* Validates that the given value is a ``datetime.datetime`` or string
|
||||||
|
@ -945,7 +945,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the
|
||||||
|
|
||||||
.. class:: ModelChoiceField(**kwargs)
|
.. class:: ModelChoiceField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``Select``
|
* Default widget: :class:`Select`
|
||||||
* Empty value: ``None``
|
* Empty value: ``None``
|
||||||
* Normalizes to: A model instance.
|
* Normalizes to: A model instance.
|
||||||
* Validates that the given id exists in the queryset.
|
* Validates that the given id exists in the queryset.
|
||||||
|
@ -1000,7 +1000,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the
|
||||||
|
|
||||||
.. class:: ModelMultipleChoiceField(**kwargs)
|
.. class:: ModelMultipleChoiceField(**kwargs)
|
||||||
|
|
||||||
* Default widget: ``SelectMultiple``
|
* Default widget: :class:`SelectMultiple`
|
||||||
* Empty value: An empty ``QuerySet`` (self.queryset.none())
|
* Empty value: An empty ``QuerySet`` (self.queryset.none())
|
||||||
* Normalizes to: A ``QuerySet`` of model instances.
|
* Normalizes to: A ``QuerySet`` of model instances.
|
||||||
* Validates that every id in the given list of values exists in the
|
* Validates that every id in the given list of values exists in the
|
||||||
|
|
Loading…
Reference in New Issue