From d75c387f46c55459a2daf071e5463bad0ad7dcbd Mon Sep 17 00:00:00 2001 From: Shivam Durgbuns <47384634+shivamdurgbuns@users.noreply.github.com> Date: Thu, 2 Dec 2021 12:15:56 +0530 Subject: Fixed #33334 -- Alphabetized form and model fields in reference docs. --- docs/ref/models/fields.txt | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'docs/ref/models') diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index be7e2a8469..402306668b 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -1111,6 +1111,37 @@ when :attr:`~django.forms.Field.localize` is ``False`` or information on the difference between the two, see Python's documentation for the :mod:`decimal` module. +``GenericIPAddressField`` +------------------------- + +.. class:: GenericIPAddressField(protocol='both', unpack_ipv4=False, **options) + +An IPv4 or IPv6 address, in string format (e.g. ``192.0.2.30`` or +``2a02:42fe::4``). The default form widget for this field is a +:class:`~django.forms.TextInput`. + +The IPv6 address normalization follows :rfc:`4291#section-2.2` section 2.2, +including using the IPv4 format suggested in paragraph 3 of that section, like +``::ffff:192.0.2.0``. For example, ``2001:0::0:01`` would be normalized to +``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All characters +are converted to lowercase. + +.. attribute:: GenericIPAddressField.protocol + + Limits valid inputs to the specified protocol. + Accepted values are ``'both'`` (default), ``'IPv4'`` + or ``'IPv6'``. Matching is case insensitive. + +.. attribute:: GenericIPAddressField.unpack_ipv4 + + Unpacks IPv4 mapped addresses like ``::ffff:192.0.2.1``. + If this option is enabled that address would be unpacked to + ``192.0.2.1``. Default is disabled. Can only be used + when ``protocol`` is set to ``'both'``. + +If you allow for blank values, you have to allow for null values since blank +values are stored as null. + ``ImageField`` -------------- @@ -1162,37 +1193,6 @@ The default form widget for this field is a :class:`~django.forms.NumberInput` when :attr:`~django.forms.Field.localize` is ``False`` or :class:`~django.forms.TextInput` otherwise. -``GenericIPAddressField`` -------------------------- - -.. class:: GenericIPAddressField(protocol='both', unpack_ipv4=False, **options) - -An IPv4 or IPv6 address, in string format (e.g. ``192.0.2.30`` or -``2a02:42fe::4``). The default form widget for this field is a -:class:`~django.forms.TextInput`. - -The IPv6 address normalization follows :rfc:`4291#section-2.2` section 2.2, -including using the IPv4 format suggested in paragraph 3 of that section, like -``::ffff:192.0.2.0``. For example, ``2001:0::0:01`` would be normalized to -``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All characters -are converted to lowercase. - -.. attribute:: GenericIPAddressField.protocol - - Limits valid inputs to the specified protocol. - Accepted values are ``'both'`` (default), ``'IPv4'`` - or ``'IPv6'``. Matching is case insensitive. - -.. attribute:: GenericIPAddressField.unpack_ipv4 - - Unpacks IPv4 mapped addresses like ``::ffff:192.0.2.1``. - If this option is enabled that address would be unpacked to - ``192.0.2.1``. Default is disabled. Can only be used - when ``protocol`` is set to ``'both'``. - -If you allow for blank values, you have to allow for null values since blank -values are stored as null. - ``JSONField`` ------------- -- cgit v1.3