| Age | Commit message (Collapse) | Author |
|
Backport of a7c3d0f288a66d327e71476e9a9bfcc791602b8c from master
|
|
Custom form fields having a `queryset` attribute but no
`limit_choices_to` could no longer be used in ModelForms.
Refs #2445.
Thanks to artscoop for the report.
Backport of bfb11b95626f39e2f5e18d97d7761c6f93dcc1a9 from master.
Conflicts:
django/forms/fields.py
|
|
Backport of f7eee04ebe from master
|
|
Thanks sebastien at clarisys.fr for the report and gautier
for the patch.
Backport of 5e2c4a4bd1 from master
|
|
Backport of 67f9f385aa from master
|
|
the admin.
Thanks Stephen Burrows for work on the patch as well.
|
|
flake8 catches
Backport of 778ce245dd466bce1b19f89e52cf9ed8f1b46513 from master
|
|
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
|
|
ForeignKey or ManyToManyField attribute ``limit_choices_to`` can now
be a callable that returns either a ``Q`` object or a dict.
Thanks michael at actrix.gen.nz for the original suggestion.
|
|
Overriding the error messages now works for both unique fields, unique_together
and unique_for_date.
This patch changed the overriding logic to allow customizing NON_FIELD_ERRORS
since previously only fields' errors were customizable.
Refs #20199.
Thanks leahculver for the suggestion.
|
|
This is the result of Christopher Medrela's 2013 Summer of Code project.
Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.
Also: Fixes #8579, fixes #3055, fixes #19844.
|
|
|
|
Thanks dibrovsd at gmail.com for the report and Simon Charette
for the review.
|
|
Refs #20199 #16986.
Thanks @akaariai, @bmispelon, @mjtamlyn, @timgraham for the reviews.
|
|
|
|
|
|
Thanks agale031176@gmail.com for the report.
|
|
On Python 3 sorting Fields mixed with GenericForeignKeys doesn't work
as GenericForeignKey isn't a subclass of django.db.models.fields.Field.
Refs #21428.
|
|
The GenericRelation refactoring removed GenericRelations from
model._meta.many_to_many. This had the side effect of disallowing
editable GenericRelations in ModelForms. Editable GenericRelations
aren't officially supported, but if we don't fix this we don't offer any
upgrade path for those who used the ability to set editable=True
in GenericRelation subclass.
Thanks to Trac alias joshcartme for the report and stephencmd and Loic
for working on this issue.
|
|
|
|
model_to_dict() (used when rendering forms) queries the database
to get the list of primary keys for ManyToMany fields. This is
unnecessary if the field queryset has been prefetched, all the
keys are already in memory and can be obtained with a simple
iteration.
|
|
When a formset contained deletion for an existing instance, and the
instance was already deleted, django threw an exception. A common cause for
this was resubmit of the formset.
Original patch by Trac alias olau.
In addition this commit cleaned some code in _construct_form(). This
was needed as the primary key value the user submitted wasn't converted
correctly to python value in case the primary key field was also a
related field.
|
|
|
|
|
|
|
|
|
|
|
|
scenarios.
Thanks apollo13, funkybob and mjtamlyn for the reviews.
|
|
Thanks PaulM for the suggestion and Luke Granger-Brown and
Wiktor Kołodziej for the initial patch.
|
|
|
|
Thanks jeroen.pulles at redslider.net for the suggestion and
helper script.
|
|
The __eq__ method now considers two instances without primary key value
equal only when they have same id(). The __hash__ method raises
TypeError for no primary key case.
Fixed #18864, fixed #18250
Thanks to Tim Graham for docs review.
|
|
Thanks Loic Bistuer for the review.
|
|
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
|
|
Thanks laureline.guerin@ and Wedg.
|
|
Thanks Tim Graham for the review.
|
|
|
|
fields
|
|
as the exception bubbles up
|
|
error_messages
|
|
Thanks margieroginski for the report.
|
|
|
|
Don't try to be smart about building a good-looking help string
because it evaluates translations too early, simply use the same old
strategy as before. Thanks Donald Stufft for the report.
Also, actually fix the case reported by the OP by special-casing
CheckboxSelectMultiple.
Added tests.
Refs #9321.
|
|
fields.
This is backward incompatible for custom form field/widgets that rely
on the hard-coded 'Hold down "Control", or "Command" on a Mac, to select
more than one.' sentence.
Application that use standard model form fields and widgets aren't
affected but need to start handling these help texts by themselves
before Django 1.8.
For more details, see the related release notes and deprecation timeline
sections added with this commit.
|
|
|
|
|
|
added '__all__' shortcut
This also updates all dependent functionality, including modelform_factory
and modelformset_factory, and the generic views `ModelFormMixin`,
`CreateView` and `UpdateView` which gain a new `fields` attribute.
|
|
Also fixed plural messages for DecimalField.
|
|
|
|
In any case, setting those variables to non-ascii utf-8 bytestrings
is now considered a programming error.
|