ciao Adam, though i'd still argue that this behaviour should be changed and it can be achieved on a reasonable path, i figured i'm better off with Jinja2, which implements a more concise syntax: http://jinja.pocoo.org/docs/2.10/templates/#variables
however, the docs of the Django templating system could be more precise here: https://docs.djangoproject.com/en/1.11/ref/templates/language/#variables > You wrote two other comments in your initial message on the ticket > about suggestions for template rendering, re: SimpleNamespace and > ChainMap. regarding the SimpleNamespace: for my gusto it would make view functions more slick and partly enable useful autocompletion in PyCharm. but in terms of speed, it would require a type check and one type conversion. if only SimpleNamespace objects would be allowed as context objects that might actually be faster, the bytecode of a mapping access has one instruction more. on the other hand, one would need a wrapper around it that modeled a (full; and no pun intended) mapping interface around for a use with the following: i gave that ChainMap thing a try, but failed by lacking a deeper understanding what's going on with some methods on some BaseContext subclasses. there's hardly inline documentation and some code parts are still weird to me. i don't have the capacity to dig into this, but it really looks promising, i'd bet about 50% code reduction if done properly and more consistence. i can provide a patch with my changes so far for an idea. btw, i'm a little confused as there's a fancy trac instance where we're not having this conversation. ?:-/ best regards, Frank -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/4dd109b7-2a7a-bcf8-cf86-3b3c57fbaa07%40riseup.net. For more options, visit https://groups.google.com/d/optout.
