Loading docs/ref/forms/fields.txt +27 −27 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ For each field, we describe the default widget used if you don't specify .. class:: BooleanField(**kwargs) * Default widget: ``CheckboxInput`` * Default widget: :class:`CheckboxInput` * Empty value: ``False`` * Normalizes to: A Python ``True`` or ``False`` value. * Validates that the value is ``True`` (e.g. the check box is checked) if Loading @@ -309,7 +309,7 @@ For each field, we describe the default widget used if you don't specify .. class:: CharField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates ``max_length`` or ``min_length``, if they are provided. Loading @@ -329,7 +329,7 @@ For each field, we describe the default widget used if you don't specify .. class:: ChoiceField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value exists in the list of choices. Loading @@ -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 extra arguments, ``coerce`` and ``empty_value``. * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: Whatever you've given as ``empty_value`` * 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 Loading @@ -382,7 +382,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DateField(**kwargs) * Default widget: ``DateInput`` * Default widget: :class:`DateInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.date`` object. * Validates that the given value is either a ``datetime.date``, Loading Loading @@ -421,7 +421,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DateTimeField(**kwargs) * Default widget: ``DateTimeInput`` * Default widget: :class:`DateTimeInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.datetime`` object. * Validates that the given value is either a ``datetime.datetime``, Loading Loading @@ -454,7 +454,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DecimalField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python ``decimal``. * Validates that the given value is a decimal. Leading and trailing Loading Loading @@ -489,7 +489,7 @@ For each field, we describe the default widget used if you don't specify .. class:: EmailField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid email address, using a Loading @@ -505,7 +505,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FileField(**kwargs) * Default widget: ``ClearableFileInput`` * Default widget: :class:`ClearableFileInput` * Empty value: ``None`` * Normalizes to: An ``UploadedFile`` object that wraps the file content and file name into a single object. Loading Loading @@ -533,7 +533,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FilePathField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``None`` * Normalizes to: A unicode object * Validates that the selected choice exists in the list of choices. Loading Loading @@ -580,7 +580,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FloatField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python float. * Validates that the given value is an float. Leading and trailing Loading @@ -596,7 +596,7 @@ For each field, we describe the default widget used if you don't specify .. class:: ImageField(**kwargs) * Default widget: ``ClearableFileInput`` * Default widget: :class:`ClearableFileInput` * Empty value: ``None`` * Normalizes to: An ``UploadedFile`` object that wraps the file content and file name into a single object. Loading @@ -621,7 +621,7 @@ For each field, we describe the default widget used if you don't specify .. class:: IntegerField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python integer or long integer. * Validates that the given value is an integer. Leading and trailing Loading @@ -644,7 +644,7 @@ For each field, we describe the default widget used if you don't specify .. class:: IPAddressField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid IPv4 address, using a regular Loading @@ -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. * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. IPv6 addresses are normalized as described below. Loading Loading @@ -693,7 +693,7 @@ For each field, we describe the default widget used if you don't specify .. class:: MultipleChoiceField(**kwargs) * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: ``[]`` (an empty list) * Normalizes to: A list of Unicode objects. * Validates that every value in the given list of values exists in the list Loading @@ -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` takes two extra arguments, ``coerce`` and ``empty_value``. * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: Whatever you've given as ``empty_value`` * Normalizes to: A list of values of the type provided by the ``coerce`` argument. Loading @@ -731,7 +731,7 @@ For each field, we describe the default widget used if you don't specify .. class:: NullBooleanField(**kwargs) * Default widget: ``NullBooleanSelect`` * Default widget: :class:`NullBooleanSelect` * Empty value: ``None`` * Normalizes to: A Python ``True``, ``False`` or ``None`` value. * Validates nothing (i.e., it never raises a ``ValidationError``). Loading @@ -741,7 +741,7 @@ For each field, we describe the default widget used if you don't specify .. class:: RegexField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value matches against a certain regular Loading @@ -768,7 +768,7 @@ For each field, we describe the default widget used if you don't specify .. class:: SlugField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value contains only letters, numbers, Loading @@ -783,7 +783,7 @@ For each field, we describe the default widget used if you don't specify .. class:: TimeField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.time`` object. * Validates that the given value is either a ``datetime.time`` or string Loading @@ -807,7 +807,7 @@ For each field, we describe the default widget used if you don't specify .. class:: URLField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid URL. Loading @@ -829,7 +829,7 @@ Slightly complex built-in ``Field`` classes .. class:: ComboField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value against each of the fields specified Loading @@ -856,7 +856,7 @@ Slightly complex built-in ``Field`` classes .. class:: MultiValueField(fields=(), **kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: the type returned by the ``compress`` method of the subclass. * Validates that the given value against each of the fields specified Loading Loading @@ -902,7 +902,7 @@ Slightly complex built-in ``Field`` classes .. class:: SplitDateTimeField(**kwargs) * Default widget: ``SplitDateTimeWidget`` * Default widget: :class:`SplitDateTimeWidget` * Empty value: ``None`` * Normalizes to: A Python ``datetime.datetime`` object. * Validates that the given value is a ``datetime.datetime`` or string Loading Loading @@ -945,7 +945,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the .. class:: ModelChoiceField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``None`` * Normalizes to: A model instance. * Validates that the given id exists in the queryset. Loading Loading @@ -1000,7 +1000,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the .. class:: ModelMultipleChoiceField(**kwargs) * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: An empty ``QuerySet`` (self.queryset.none()) * Normalizes to: A ``QuerySet`` of model instances. * Validates that every id in the given list of values exists in the Loading Loading
docs/ref/forms/fields.txt +27 −27 Original line number Diff line number Diff line Loading @@ -289,7 +289,7 @@ For each field, we describe the default widget used if you don't specify .. class:: BooleanField(**kwargs) * Default widget: ``CheckboxInput`` * Default widget: :class:`CheckboxInput` * Empty value: ``False`` * Normalizes to: A Python ``True`` or ``False`` value. * Validates that the value is ``True`` (e.g. the check box is checked) if Loading @@ -309,7 +309,7 @@ For each field, we describe the default widget used if you don't specify .. class:: CharField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates ``max_length`` or ``min_length``, if they are provided. Loading @@ -329,7 +329,7 @@ For each field, we describe the default widget used if you don't specify .. class:: ChoiceField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value exists in the list of choices. Loading @@ -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 extra arguments, ``coerce`` and ``empty_value``. * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: Whatever you've given as ``empty_value`` * 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 Loading @@ -382,7 +382,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DateField(**kwargs) * Default widget: ``DateInput`` * Default widget: :class:`DateInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.date`` object. * Validates that the given value is either a ``datetime.date``, Loading Loading @@ -421,7 +421,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DateTimeField(**kwargs) * Default widget: ``DateTimeInput`` * Default widget: :class:`DateTimeInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.datetime`` object. * Validates that the given value is either a ``datetime.datetime``, Loading Loading @@ -454,7 +454,7 @@ For each field, we describe the default widget used if you don't specify .. class:: DecimalField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python ``decimal``. * Validates that the given value is a decimal. Leading and trailing Loading Loading @@ -489,7 +489,7 @@ For each field, we describe the default widget used if you don't specify .. class:: EmailField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid email address, using a Loading @@ -505,7 +505,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FileField(**kwargs) * Default widget: ``ClearableFileInput`` * Default widget: :class:`ClearableFileInput` * Empty value: ``None`` * Normalizes to: An ``UploadedFile`` object that wraps the file content and file name into a single object. Loading Loading @@ -533,7 +533,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FilePathField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``None`` * Normalizes to: A unicode object * Validates that the selected choice exists in the list of choices. Loading Loading @@ -580,7 +580,7 @@ For each field, we describe the default widget used if you don't specify .. class:: FloatField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python float. * Validates that the given value is an float. Leading and trailing Loading @@ -596,7 +596,7 @@ For each field, we describe the default widget used if you don't specify .. class:: ImageField(**kwargs) * Default widget: ``ClearableFileInput`` * Default widget: :class:`ClearableFileInput` * Empty value: ``None`` * Normalizes to: An ``UploadedFile`` object that wraps the file content and file name into a single object. Loading @@ -621,7 +621,7 @@ For each field, we describe the default widget used if you don't specify .. class:: IntegerField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python integer or long integer. * Validates that the given value is an integer. Leading and trailing Loading @@ -644,7 +644,7 @@ For each field, we describe the default widget used if you don't specify .. class:: IPAddressField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid IPv4 address, using a regular Loading @@ -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. * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. IPv6 addresses are normalized as described below. Loading Loading @@ -693,7 +693,7 @@ For each field, we describe the default widget used if you don't specify .. class:: MultipleChoiceField(**kwargs) * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: ``[]`` (an empty list) * Normalizes to: A list of Unicode objects. * Validates that every value in the given list of values exists in the list Loading @@ -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` takes two extra arguments, ``coerce`` and ``empty_value``. * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: Whatever you've given as ``empty_value`` * Normalizes to: A list of values of the type provided by the ``coerce`` argument. Loading @@ -731,7 +731,7 @@ For each field, we describe the default widget used if you don't specify .. class:: NullBooleanField(**kwargs) * Default widget: ``NullBooleanSelect`` * Default widget: :class:`NullBooleanSelect` * Empty value: ``None`` * Normalizes to: A Python ``True``, ``False`` or ``None`` value. * Validates nothing (i.e., it never raises a ``ValidationError``). Loading @@ -741,7 +741,7 @@ For each field, we describe the default widget used if you don't specify .. class:: RegexField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value matches against a certain regular Loading @@ -768,7 +768,7 @@ For each field, we describe the default widget used if you don't specify .. class:: SlugField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value contains only letters, numbers, Loading @@ -783,7 +783,7 @@ For each field, we describe the default widget used if you don't specify .. class:: TimeField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``None`` * Normalizes to: A Python ``datetime.time`` object. * Validates that the given value is either a ``datetime.time`` or string Loading @@ -807,7 +807,7 @@ For each field, we describe the default widget used if you don't specify .. class:: URLField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid URL. Loading @@ -829,7 +829,7 @@ Slightly complex built-in ``Field`` classes .. class:: ComboField(**kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value against each of the fields specified Loading @@ -856,7 +856,7 @@ Slightly complex built-in ``Field`` classes .. class:: MultiValueField(fields=(), **kwargs) * Default widget: ``TextInput`` * Default widget: :class:`TextInput` * Empty value: ``''`` (an empty string) * Normalizes to: the type returned by the ``compress`` method of the subclass. * Validates that the given value against each of the fields specified Loading Loading @@ -902,7 +902,7 @@ Slightly complex built-in ``Field`` classes .. class:: SplitDateTimeField(**kwargs) * Default widget: ``SplitDateTimeWidget`` * Default widget: :class:`SplitDateTimeWidget` * Empty value: ``None`` * Normalizes to: A Python ``datetime.datetime`` object. * Validates that the given value is a ``datetime.datetime`` or string Loading Loading @@ -945,7 +945,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the .. class:: ModelChoiceField(**kwargs) * Default widget: ``Select`` * Default widget: :class:`Select` * Empty value: ``None`` * Normalizes to: A model instance. * Validates that the given id exists in the queryset. Loading Loading @@ -1000,7 +1000,7 @@ objects (in the case of ``ModelMultipleChoiceField``) into the .. class:: ModelMultipleChoiceField(**kwargs) * Default widget: ``SelectMultiple`` * Default widget: :class:`SelectMultiple` * Empty value: An empty ``QuerySet`` (self.queryset.none()) * Normalizes to: A ``QuerySet`` of model instances. * Validates that every id in the given list of values exists in the Loading