Re: "Variables and attributes may not begin with underscores" error

2018-06-30 Thread Tim Graham
I think the reason is that underscore-prefixed attributes are generally considered to be private. Accessing them in templates doesn't seem like good practice. On Friday, June 29, 2018 at 6:44:56 PM UTC-4, Gregory Kaleka wrote: > > The docs do mention it on the more complete template api page >

Re: "Variables and attributes may not begin with underscores" error

2018-06-29 Thread Gregory Kaleka
The docs do mention it on the more complete template api page , though there isn't an explanation as to the reason. I would say it should at least be added to the template docs you link to. On Friday, June 29, 2018

"Variables and attributes may not begin with underscores" error

2018-06-29 Thread Raffaele Salmaso
Hi, anyone knows the rationale for forbidding variables and attributes with an initial underscore in django templates? This limitation is here from day 0 https://github.com/django/django/blob/ed114e15106192b22ebb78ef5bf5bce72b419d13/django/core/template.py#L261 and docs doesn't mention it (or simpl