diff options
| author | arjunomray <arjunomray@gmail.com> | 2024-07-26 07:39:19 +0200 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-08-02 09:51:49 +0200 |
| commit | 946c3cf7342cc40c2d8e3d865c96a4ec990f76f4 (patch) | |
| tree | f1fab0e3223cf1c4c286f784b3365f0b0bc7c70b /django | |
| parent | 54e8b4e5825eadf94ad715459f3aa60df389c8d4 (diff) | |
Fixed #35599 -- Added ColorInput widget.
Diffstat (limited to 'django')
| -rw-r--r-- | django/forms/jinja2/django/forms/widgets/color.html | 1 | ||||
| -rw-r--r-- | django/forms/templates/django/forms/widgets/color.html | 1 | ||||
| -rw-r--r-- | django/forms/widgets.py | 6 |
3 files changed, 8 insertions, 0 deletions
diff --git a/django/forms/jinja2/django/forms/widgets/color.html b/django/forms/jinja2/django/forms/widgets/color.html new file mode 100644 index 0000000000..08b1e61c0b --- /dev/null +++ b/django/forms/jinja2/django/forms/widgets/color.html @@ -0,0 +1 @@ +{% include "django/forms/widgets/input.html" %} diff --git a/django/forms/templates/django/forms/widgets/color.html b/django/forms/templates/django/forms/widgets/color.html new file mode 100644 index 0000000000..08b1e61c0b --- /dev/null +++ b/django/forms/templates/django/forms/widgets/color.html @@ -0,0 +1 @@ +{% include "django/forms/widgets/input.html" %} diff --git a/django/forms/widgets.py b/django/forms/widgets.py index e7717c2ff6..f1e233865c 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -30,6 +30,7 @@ __all__ = ( "NumberInput", "EmailInput", "URLInput", + "ColorInput", "SearchInput", "PasswordInput", "HiddenInput", @@ -354,6 +355,11 @@ class URLInput(Input): template_name = "django/forms/widgets/url.html" +class ColorInput(Input): + input_type = "color" + template_name = "django/forms/widgets/color.html" + + class SearchInput(Input): input_type = "search" template_name = "django/forms/widgets/search.html" |
