summaryrefslogtreecommitdiff
path: root/django/contrib/admin/widgets.py
AgeCommit message (Collapse)Author
2026-04-02Fixed #36949 -- Improved RelatedFieldWidgetWrapper <label>s.David Smith
Regression in 4187da258fe212d494cb578a0bc2b52c4979ab95.
2026-01-22Fixed #13883 -- Rendered named choice groups with <optgroup> in ↵seanhelvey
FilteredSelectMultiple. This patch adds support for <optgroup>s in FilteredSelectMultiple widgets. When a popup returns a new object, if the source field contains optgroup choices, the optgroup is now also included in the response data. Additionally, this adds error handling for invalid source_model parameters to prevent crashes and display user-friendly error messages instead. Co-authored-by: Michael McLarnon <mmclar@gmail.com>
2025-12-31Fixed #36829 -- Reverted value of ClearableFileInput.use_fieldset to True.Johannes Maron
There was unresolved discussion regarding whether to set ClearableFileInput.use_fieldset to True or False when use_fieldset was introduced in Django 4.1, since the clear checkbox appears only sometimes. Although using <fieldset> is likely desirable, since the primary motivation in #35892 was just to improve markup in the admin, and a deprecation path was not provided for general form usage, future work is deferred to #36828. Regression in 4187da258fe212d494cb578a0bc2b52c4979ab95. Thanks Tim Graham, Antoliny, and David Smith for triage.
2025-08-29Fixed #34624 -- Removed change, delete, and view buttons for non-Select ↵SaJH
widgets in RelatedFieldWidgetWrapper. Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-19Fixed #35892 -- Supported Widget.use_fieldset in admin forms.antoliny0919
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-23Refs #36500 -- Shortened some long docstrings and comments.Mike Edmunds
Manually reformatted some long docstrings and comments that would be damaged by the to-be-applied autofixer script, in cases where editorial judgment seemed necessary for style or wording changes.
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2024-08-06Fixed CVE-2024-41991 -- Prevented potential ReDoS in ↵Mariusz Felisiak
django.utils.html.urlize() and AdminURLFieldWidget. Thanks Seokchan Yoon for the report. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-06-12Fixed #34789 -- Prevented updateRelatedSelectsOptions fromDevin Cox
adding entries to filter_horizontal chosen box. Co-authored-by: yokeshwaran1 <yokesh440@yahoo.com>
2024-04-02Fixed #35330 -- Fixed the update of related widgets when the referenced ↵devin13cox
model is camel case named. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-12-14Used model's Options.model_name instead of object_name.lower().Mariusz Felisiak
Follow up to 20d487c27b40bb70496ddc7419011ca78b7d4940.
2023-08-30 Fixed #31262 -- Added support for mappings on model fields and ↵Nick Pope
ChoiceField's choices.
2023-07-06Used AdminSite.is_registered() where appropriate.Mariusz Felisiak
2023-06-09Fixed #34645 -- Restored alignment for admin date/time timezone warnings.Mariusz Felisiak
Regression in 96a598356a9ea8c2c05b22cadc12e256a3b295fd.
2022-08-03Fixed #33888 -- Fixed get_select2_language() crash with no language activated.Claude Paroz
Regression in 3079133c73f3b8b0e929673b06b62dce1f54be71.
2022-04-15Fixed #11803 -- Allowed admin select widgets to display new related objects.mgaligniana
Adjusted admin javascript to add newly created related objects to already loaded select widgets. In this version, applies only where limit_choices_to is not set.
2022-02-25Fixed #33267 -- Added link to related item to related widget wrapper in admin.Shubh1815
2022-02-18Fixed #33514 -- Added fallbacks to subsequent language codes in Select2 ↵My-Name-Is-Nabil
translations.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-11-29Fixed #32545 -- Improved admin widget for raw_id_fields for UUIDFields.Shubh1815
Co-Authored-By: Jerome Leclanche <jerome@leclan.ch>
2021-09-21Fixed #33070 -- Fixed loading translations with language subtags in admin's ↵Cleiton Lima
Select2 widget.
2021-03-18Fixed #32466 -- Corrected autocomplete to_field resolution for complex cases.Johannes Maron
In MTI or ForeignKey as primary key cases, it is required to fetch the attname from the field instance on the remote model in order to reliably resolve the to_field_name. Co-authored-by: Johannes Maron <info@johanneshoppe.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2021-01-12Fixed #29010, Fixed #29138 -- Added limit_choices_to and to_field support to ↵Johannes Maron
autocomplete fields. * Fixed #29010 -- Added limit_choices_to support to autocomplete fields. * Fixed #29138 -- Allowed autocomplete fields to target a custom to_field rather than the PK.
2020-06-03Fixed CVE-2020-13596 -- Fixed potential XSS in admin ForeignKeyRawIdWidget.Jon Dufresne
2020-03-24Fixed #31365 -- Removed jQuery usage in SelectFilter2.js.Jon Dufresne
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-08-27Fixed #30722 -- Added default rate-limiting requests to admin's Select2 widget.Federico Jaramillo Martínez
2019-06-03Fixed CVE-2019-12308 -- Made AdminURLFieldWidget validate URL before ↵Carlton Gibson
rendering clickable link.
2018-11-19Fixed #29961 -- Made RelatedFieldWidgetWrapper hide related item links if ↵redodo
wrapping a hidden widget.
2018-09-25Normalized spelling of "lowercase" and "lowercased".Jon Dufresne
2018-08-21Fixed #29654 -- Made text truncation an ellipsis character instead of three ↵Claude Paroz
dots. Thanks Sudhanshu Mishra for the initial patch and Tim Graham for the review.
2018-08-18Fixed #29426 -- Made UUID inputs in the admin match the width of a UUID.mackong
2018-08-06Fixed #28529 -- Fixed VariableDoesNotExist warnings in admin templates.Vlastimil Zíma
2018-07-20Fixed #29523 -- Removed jQuery usage in DateTimeShortcuts.js & collapse.js.Claude Paroz
2018-05-16Fixed #8936 -- Added a view permission and a read-only admin.olivierdalang
Co-authored-by: Petr Dlouhy <petr.dlouhy@email.cz> Co-authored-by: Olivier Dalang <olivier.dalang@gmail.com>
2018-03-15Fixed #29221 -- Corrected admin's autocomplete widget to add a space after ↵Artem Tabolin
custom classes.
2018-03-13Fixed #29213 -- Fixed autocomplete widget's translations for zh-hans/zh-hant.dzhuang
2018-03-03Condensed some widgets code.Daniel Hahler
2018-02-01Fixed #29094 -- Fixed crash when entering an invalid uuid in ↵Tim Graham
ModelAdmin.raw_id_fields. Regression in 2f9861d823620da7ecb291a8f005f53da12b1e89. Thanks Carel Burger for the report and fix.
2018-01-12Fixed #28996 -- Simplified some boolean constructs and removed trivial ↵Дилян Палаузов
continue statements.
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-12-01Fixed #28871 -- Fixed initialization of autocomplete widgets in "Add ↵Tim Graham
another" inlines. Also allowed autocomplete widgets to work on AdminSites with a name other than 'admin'.
2017-11-17Refs #28814 -- Fixed "SyntaxError: Generator expression must be ↵Tim Graham
parenthesized" on Python 3.7. Due to https://bugs.python.org/issue32012.
2017-09-18Fixed #14370 -- Allowed using a Select2 widget for ForeignKey and ↵Johannes Hoppe
ManyToManyField in the admin. Thanks Florian Apolloner and Tim Graham for review and contributing to the patch.
2017-09-05Simplified admin.widgets.url_params_from_lookup_dict().Sergey Fedoseev
2017-07-20Fixed #28377 -- Made combining form Media retain relative asset order.Johannes Hoppe
Thanks Florian Apolloner, Mariusz Felisiak, and Tim Graham for reviews.
2017-04-27Refs #27795 -- Replaced many force_text() with str()Claude Paroz
Thanks Tim Graham for the review.
2017-03-21Refs #27919 -- Changed contrib widget's get_context() attrs kwarg to an arg.Tim Graham
Follow up to 075e93c16a82ba7869a0b2d572e99fdbd0724042.