Skip to content

Commit

Permalink
Refs #34380 -- Improved docs for forms.URLField.assume_scheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored and felixxm committed Nov 25, 2023
1 parent 978680d commit 0203771
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions docs/ref/forms/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1141,12 +1141,16 @@ For each field, we describe the default widget used if you don't specify
* Error message keys: ``required``, ``invalid``

Has the optional arguments ``max_length``, ``min_length``, ``empty_value``
which work just as they do for :class:`CharField`, and ``assume_scheme``
that defaults to ``"http"``.
which work just as they do for :class:`CharField`, and one more argument:

.. versionchanged:: 5.0
.. attribute:: assume_scheme

.. versionadded:: 5.0

The ``assume_scheme`` argument was added.
The scheme assumed for URLs provided without one. Defaults to
``"http"``. For example, if ``assume_scheme`` is ``"https"`` and the
provided value is ``"example.com"``, the normalized value will be
``"https://example.com"``.

.. deprecated:: 5.0

Expand Down
4 changes: 2 additions & 2 deletions docs/releases/5.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ File Storage
Forms
~~~~~

* The new ``assume_scheme`` argument for :class:`~django.forms.URLField` allows
specifying a default URL scheme.
* The new :attr:`~django.forms.URLField.assume_scheme` argument for
:class:`~django.forms.URLField` allows specifying a default URL scheme.

* In order to improve accessibility, the following changes are made:

Expand Down

0 comments on commit 0203771

Please sign in to comment.