Skip to content
Myr

documented pylons' "strict_c".

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent a433c20 · Browse files · 2 files+11 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−4 removed

  • other:+11 added−4 removed

2 files+11 added−4 removed

modified:docs/src/frameworks.txt+10 added
85 unmodified lines
86It's meant to be used as replacement for the turbogears package name but87Jinja assumes that the name of the template does not include the package88path.8990.. admonition:: Note9192 Special note for pylons users. Jinja will be unable to request attributes93 from the special `c` object, unless you set `strict_c` to `True` in the94 `environment.py`:9596 .. sourcecode:: python9798 return pylons.config.Config(tmpl_options, map, paths, strict_c=True)99100You can then render the template in the view like this:101102.. sourcecode:: python103
144 unmodified lines
modified:jinja/utils.py+1 added-4 removed
200 unmodified lines
201 name.startswith('func_') or name.startswith('im_'):202 raise SecurityException('not allowed to access function attributes')203204 r = _getattr(obj, 'jinja_allowed_attributes', None)205 # the empty string check is for pylons which returns empty strings on206 # it's stacked something foobar object207 if r not in (None, '') and name not in r:205 if r is not None and name not in r:208 print "broken here"206 raise SecurityException('disallowed attribute accessed')207208 # attribute lookups convert unicode strings to ascii bytestrings.209 # this process could raise an UnicodeEncodeError.
436 unmodified lines