1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Merge branch 'django:main' into ticket_34034

This commit is contained in:
Mariana
2024-10-09 15:39:13 +01:00
committed by GitHub
613 changed files with 13617 additions and 5301 deletions

View File

@@ -801,11 +801,11 @@ For each field, we describe the default widget used if you don't specify
* Error message keys: ``required``, ``invalid``, ``missing``, ``empty``,
``invalid_image``
Using an ``ImageField`` requires that `Pillow`_ is installed with support
for the image formats you use. If you encounter a ``corrupt image`` error
when you upload an image, it usually means that Pillow doesn't understand
its format. To fix this, install the appropriate library and reinstall
Pillow.
Using an ``ImageField`` requires that :pypi:`pillow` is installed with
support for the image formats you use. If you encounter a ``corrupt image``
error when you upload an image, it usually means that Pillow doesn't
understand its format. To fix this, install the appropriate library and
reinstall Pillow.
When you use an ``ImageField`` on a form, you must also remember to
:ref:`bind the file data to the form <binding-uploaded-files>`.
@@ -851,7 +851,6 @@ For each field, we describe the default widget used if you don't specify
image's content type if Pillow can determine it, otherwise it will be set
to ``None``.
.. _Pillow: https://pillow.readthedocs.io/en/latest/
.. _Image: https://pillow.readthedocs.io/en/latest/reference/Image.html
``IntegerField``

View File

@@ -570,6 +570,48 @@ These widgets make use of the HTML elements ``input`` and ``textarea``.
* ``template_name``: ``'django/forms/widgets/url.html'``
* Renders as: ``<input type="url" ...>``
``ColorInput``
~~~~~~~~~~~~~~
.. versionadded:: 5.2
.. class:: ColorInput
* ``input_type``: ``'color'``
* ``template_name``:``'django/forms/widgets/color.html'``
* Renders as: ``<input type="color" ...>``
``SearchInput``
~~~~~~~~~~~~~~~
.. versionadded:: 5.2
.. class:: SearchInput
* ``input_type``: ``'search'``
* ``template_name``: ``'django/forms/widgets/search.html'``
* Renders as: ``<input type="search" ...>``
``TelInput``
~~~~~~~~~~~~
.. versionadded:: 5.2
.. class:: TelInput
* ``input_type``: ``'tel'``
* ``template_name``: ``'django/forms/widgets/tel.html'``
* Renders as: ``<input type="tel" ...>``
Browsers perform no client-side validation by default because telephone
number formats vary so much around the world. You can add some by setting
``pattern``, ``minlength``, or ``maxlength`` in the :attr:`Widget.attrs`
argument.
Additionally, you can add server-side validation to your form field with a
validator like :class:`~django.core.validators.RegexValidator` or via
third-party packages, such as :pypi:`django-phonenumber-field`.
``PasswordInput``
~~~~~~~~~~~~~~~~~