This change allows dynamically created inlines "Add related" button to work
correcly as long as their associated foreign key is pointing to the primary
key of the related model.
Thanks to amorce for the report, Julien Phalip for the initial patch,
and Collin Anderson for the review.
Backport of f9c4e14aeca7df79991bca8ac2d743953cbd095c from master
This rename is very tricky for the case of subclasses which define
get_query_set and haven't been updated yet, which applies to all projects in
the form of RelatedManager from Django 1.5.
Backport of 0c623da66406d1f20b5e26d497d57da5ad0de066 from master
The Preventing header injection example included
classes that are not imported.
Thanks to Collin Anderson and Berker Peksağ for the
reviews.
Backport of 0d74209ef66111f29f122d5f5fdf8e2964890cc5 from master.
This reverts commit 8014001d9287d516c58be80ad71fb63593648b3d.
Adding kwargs to deconstructed objects does not achieve useful
forward-compatibility in general, since the additional kwargs are silently
dropped rather than having their expected effect. In fact, it can cause the
failure to be more difficult to debug. Thanks Shai Berger for discussion.
Also added a unit test wit the simpler syntax which we have documented,
where the dictionary values are strings.
Backport of 5b26a014a81ba0d404d46e11d2b45c01d92b97e5 from master
Added relabeled_clone() method to sql.Query to fix the problem. It
manifested itself in rare cases where at least double nested subquery's
filter condition might target non-existing alias.
Thanks to Trac alias ris for reporting the problem.
Backport of 5c481db29572a387651681b43d5d4523f96b3793 from master
Removed inaccurate info about partial evaluation after refs #18702.
Added information on modifying sliced QuerySets; refs #22503.
Backport of 327df551e89a505c5756becee97c40198f38aff2 from master
Documentation for rendering form fields manually is now updated to use fields id_for_label instead of hardcoded values with additional mention of label_tag for alternative generation of complete label tag.
Backport of 48515ee1f7bec437544a0a958332483298f4028b from master
The example for django.contrib.admin.ModelAdmin.get_form modifies
self.exclude. However, since ModelAdmin instances are global and have no
thread- or request-locality, this is not safe for concurrent
requests.[1] This updated documentation demonstrates a safe method to
override admin forms on a per-request basis.
[1] https://groups.google.com/forum/#!topic/django-users/AmoUDtEefyA
Backport of 0d1a9d203a970a82a2f81edf0ba7d4b55442fd78 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
This snippet wasn't particularly helpful as `add_error()` is described
in greater details in the following section.
Thanks Claude Paroz for the report.
Backport of f1f0c4f16b from master