This reverts commit f36151ed16.
Adding kwargs to deconstructed objects does not achieve useful
forward-compatibility in general, since additional arguments are silently
dropped rather than having their intended effect. In fact, it can make the
failure more difficult to diagnose. Thanks Shai Berger for discussion.
This change preserves backwards-compatibility for a very common misuse
of render_to_response which even occurred in the official documentation.
It fixes that misuse wherever it happened in the code base and docs.
Context.__init__ is documented as accepting a dict and nothing else.
Since Context is dict-like, Context(Context({})) could work to some
extent. However, things get complicated with RequestContext and that
gets in the way of refactoring the template engine. This is the real
rationale for this change.
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.
Introduced the various shortcuts before explaining the more complex
parser/render functionality.
Also removed non-decorator syntax: it's been years since Django
supported a Python version without decorators.
They were deprecated in Django 1.2 but not all the supporting code was
removed in Django 1.4. Since the remaining code was unlikely to be
functional (pun intended) e.g. it would crash unless the loader
function had an is_usable attribute, this commit completes the removal
immediately instead of starting another deprecation path.
Reformatted the code of base.Loader according to modern standards.
Turned the test template loader into a regular locmem.Loader -- but
didn't document it.
Added a normal deprecation path for BaseLoader which is a public API.
Added an accelerated deprecation path for TestTemplateLoader which is
a private API.
Fixes a race condition in the documentation.
The example for django.contrib.admin.ModelAdmin.get_form was modifying self.exclude. However, since ModelAdmin instances are global and have no thread- or request-locality, this is not safe for concurrent requests. This updated documentation demonstrates a safe method to override admin forms on a per-request basis.
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
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.
This is derived from the current behaviour of FileSystemStorage.
Note that since this was not previously documented, other
implementations may not currently conform.