Previous algo only worked if the first item was a part of the loop,
and you would get an infinite loop otherwise (see test).
To fix this, it was much easier to do a pre-pass.
A bonus is that you now get an error message that actually helps you debug
the dependency problem.
Backport of ff3d746e8d from master, with
additional tests from c5def493d0
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 f9c4e14aec 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 0c623da664 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 0d74209ef6 from master.
This reverts commit 8014001d92.
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.
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 5c481db295 from master
Removed inaccurate info about partial evaluation after refs #18702.
Added information on modifying sliced QuerySets; refs #22503.
Backport of 327df551e8 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 48515ee1f7 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 0d1a9d203a 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 bfb11b9562 from master.
Conflicts:
django/forms/fields.py