summaryrefslogtreecommitdiff
path: root/django/forms/models.py
AgeCommit message (Collapse)Author
2022-11-04Fixed #27654 -- Propagated alters_data attribute to callables overridden in ↵LightDiscord
subclasses. Thanks Shai Berger and Adam Johnson for reviews and the implementation idea.
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-08-08Fixed #31721 -- Allowed ModelForm meta to specify form fields.Kamil Turek
2022-07-05Fixed #33822 -- Fixed save() crash on model formsets when not created by ↵Shawn Dong
modelformset_factory(). Thanks Claude Paroz for the report. Regression in e87f57fdb8dcdabc452bd15abd015bf6c9b1f7a8.
2022-05-10Fixed #30581 -- Added support for Meta.constraints validation.Gagaro
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
2022-03-16Used sets for field names for exclusion.Gagaro
They are used only for containment checks.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-03Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
2022-01-27Fixed #26142 -- Allowed model formsets to prevent new object creation.vgolubev
Thanks Jacob Walls, David Smith, and Mariusz Felisiak for reviews. Co-authored-by: parth <parthvin@gmail.com>
2021-09-30Fixed #33155 -- Made ModelChoiceIteratorValue instances hashable.Aljaž Košir
2021-09-20Fixed #31026 -- Switched form rendering to template engine.David Smith
Thanks Carlton Gibson, Keryn Knight, Mariusz Felisiak, and Nick Pope for reviews. Co-authored-by: Johannes Hoppe <info@johanneshoppe.com>
2021-09-03Fixed #32975 -- Fixed admin system check for inlines with foreign keys to ↵taulant
proxy models.
2021-01-26Fixed #32347 -- Made ModelChoiceField include the value in ValidationError ↵Jerin Peter George
for invalid_choice.
2021-01-14Refs #8760 -- Removed "list" message for ModelMultipleChoiceField per ↵Mariusz Felisiak
deprecation timeline.
2020-10-27Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on ↵alvinshaita
multi-value relations.
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-06-24Fixed #9061 -- Allowed FormSets to disable deleting extra forms.David Smith
Thanks to Dan Ward for the initial patch.
2020-06-05Fixed #20347 -- Allowed customizing the maximum number of instantiated forms ↵David Smith
in formsets. Co-authored-by: ethurgood <ethurgood@gmail.com>
2020-03-12Fixed #8760 -- Changed ModelMultipleChoiceField to use invalid_list as a ↵David Smith
error message key.
2020-02-05Fixed #26813 -- Prevented empty choice in ModelChoiceField with RadioSelect ↵Hasan Ramezani
for fields with blank=False.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-12-23Fixed #30998 -- Added ModelChoiceIteratorValue to pass the model instance to ↵Jon Dufresne
ChoiceWidget.create_option().
2019-12-17Fixed #31086 -- Improved error message for admin model inlines with more ↵Shubham singh
than one foreign key to the same parent.
2019-11-28Refs #23919 -- Replaced super(...) with super() in metaclasses.Jon Dufresne
2019-10-11Fixed #30014 -- Fixed ModelChoiceField validation when initial value is a ↵Etienne Chové
model instance. Thanks Carlton Gibson for reviews.
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2019-06-20Added missing form argument in modelform_factory() docstring.Tobias Kunze
2019-06-04Fixed #30534 -- Fixed overriding a field's default in ModelForm.cleaned_data().RobertAKARobin
2019-04-03Fixed #30302 -- Fixed forms.model_to_dict() result if empty list of fields ↵belegnar
is passed.
2019-02-06Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope
Dicts preserve order since Python 3.6.
2019-01-01Fixed #29981 -- Fixed inline formsets with a OnetoOneField primary key that ↵Patrik Sletmo
uses to_field.
2018-08-21Fixed #29696 -- Prevented BaseModelFormSet.initial_form_count()'s from ↵Jon Dufresne
treating data={} as unbound.
2018-07-30Fixed #26819 -- Fixed BaseModelFormSet.validate_unique() "unhashable type: ↵Demur Nodia
list" crash.
2018-06-07Fixed #29474 -- Simplified BaseInlineFormset.save_new().Tim Graham
2018-04-23Refs #28312 -- Added an optimized __bool__() to ModelChoiceIterator.François Freitag
COUNT is more expensive than EXISTS; use the latter when possible.
2018-04-23Fixed #28312 -- Made ModelChoiceIterator.__len__() more memory-efficient.François Freitag
Instead of loading all QuerySet results in memory, count the number of entries. This adds an extra query when list() or tuple() is called on the choices (because both call __len__() then __iter__()) but uses less memory since the QuerySet results won't be cached. In most cases, the choices will only be iterated on, meaning that __len__() won't be called and only one query will be executed.
2018-03-31Fixed #29279 -- Added renderer argument to ModelForm.Dan Watson
2018-03-01Fixed #29159 -- Made ModelChoiceIterator reuse QuerySet result cache.François Freitag
When __len__() is called (e.g. when casting to list or tuple), the QuerySet is evaluated and the result cache populated. iterator() shouldn't be called on the QuerySet after that, as it would reset the result cache and trigger a second query.
2018-03-01Fixed #29158 -- Fixed len(choices) crash if ModelChoiceField's queryset is a ↵François Freitag
manager. Removing all() in __iter__() prevents a duplicate query when choices are cast to a list and there's a prefetch_related().
2018-01-12Fixed #28996 -- Simplified some boolean constructs and removed trivial ↵Дилян Палаузов
continue statements.
2018-01-03Fixed #28985 -- Removed unneeded None checks before hasattr().Дилян Палаузов
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-12-04Fixed #28860 -- Removed unnecessary len() calls.Дилян Палаузов
2017-09-13Removed unnecessary parens in various code.Mariusz Felisiak
2017-09-13Merged isinstance() calls.Mariusz Felisiak
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-07-29Avoided creation of temporary sets.Sergey Fedoseev
2017-07-14Fixed #28387 -- Fixed has_changed() for disabled form fields that subclass it.Srinivas Reddy Thatiparthy
2017-07-11Fixed #22229 -- Added primary key validation to ↵Jon Dufresne
BaseModelFormSet._construct_form().