Previously related fields didn't implement get_lookup, instead
related fields were treated specially. This commit removed some of
the special handling. In particular, related fields return Lookup
instances now, too.
Other notable changes in this commit is removal of support for
annotations in names_to_path().
Consolidated it in one file and move the DOM related stuff to the
template so it is easily overridable. To override the popup behavior
you need to add handlers for the custom events triggered in the
admin_change_form_document_ready template block.
If Field.choices is provided as an iterator, consume it in __init__ instead
of using itertools.tee (which ends up holding everything in memory
anyway). Fixes a bug where deconstruct() was consuming the iterator but
bypassing the call to `tee`.
When reversing, only outer parameters are used if captured parameters are
nested. Added tests to check the edge cases and documentation for the
behavior with an example to avoid it.
This reverts commit e0cc36f615.
The problem is the following:
* With non-gis backends, gis_tests sub apps are not discovered
(see runtests.py)
* Consequently, the app_label is inferred from the gis_tests
AppConfig
* Then models with same names in different sub apps conflict
because of same model_name/app_label pair.
Table alterations in SQLite require creating a new table and copying
data over from the old one. This change ensures that no Django model
ever exists with the temporary table name as its db_table attribute.
This patch does three major things:
* Merges the django.template.debug implementation into django.template.base.
* Simplifies the debug implementation.
The old implementation copied debug information to every token and node.
The django_template_source attribute was set in multiple places, some
quite hacky, like django.template.defaulttags.ForNode.
Debug information is now annotated in two high-level places:
* Template.compile_nodelist for errors during parsing
* Node.render_annotated for errors during rendering
These were chosen because they have access to the template and context
as well as to all exceptions that happen during either the parse or
render phase.
* Moves the contextual line traceback information creation from
django.views.debug into django.template.base.Template. The debug views now
only deal with the presentation of the debug information.