#16389: In Django 1.3, dictionary lookup now calls the value if callable making
classes unusable
-------------------------------------------------+-------------------------
Reporter: iElectric | Owner: nobody
Type: Bug | Status: new
Milestone: | Component:
Version: 1.3 | Template system
Keywords: template lookup dictionary callable | Severity: Normal
Has patch: 0 | Triage Stage:
UI/UX: 0 | Unreviewed
| Easy pickings: 0
-------------------------------------------------+-------------------------
I used to have context processor that returned a dict of all registered
model classes. This used to work in Django 1.2.x very well and removed the
need of redundant imports.
Let's refer to [https://docs.djangoproject.com/en/1.3/ref/templates/api/
documentation]:
> If any part of the variable is callable, the template system will try
calling it.
And the change:
> Changed in Django 1.3: Previously, only variables that originated with
an attribute lookup would be called by the template system. This change
was made for consistency across lookup types.
This is a pretty big design change, I wonder what "consistency" implies
here. For example, you can not do anymore in the templates:
{{{
{{ User.objects.all }}
}}}
Because your User will become and User instance, since it's looked up in
Context, which is an dictionary. As a side effect, there is no way you can
use class in the template anymore.
--
Ticket URL: <https://code.djangoproject.com/ticket/16389>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.