Closed funkybob closed 5 years ago
If we expand the syntax to distinguish the different lookups, we can go back to using '.' for attr lookups.
Suggestion:
foo
foo.bar
foo['bar']
foo[bar.baz]
foo(bar, baz)
Given that I'm not really using any floats in my templates I would like the ability to look up with .
I'm also proposing dropping the "flow / filter" concept, so instead of :
{{ foo:bar|prefix:"six" }}
you would write:
{{ prefix(foo.bar, 'six') }}
Currently, because I reuse the Python tokeniser, I can't use '.' as the lookup separator in expressions (because of ambiguities with floats).
Currently I'm using ':' but this plays double role with filter expressions.
Looking https://docs.python.org/2.7/reference/lexical_analysis.html#delimiters can anyone see a better symbol for this role?
I've currently a version of the code using '/'... it's easy to change.