On Sun, Oct 17, 2010 at 05:35:19PM -0700, Roy Smith wrote:
> I've just started playing with Pylons.  I've been working my way
> through the examples in http://pylonsbook.com/en/1.1/using-view-templates.html
> and decided to try out strict mode.
> 
> I intentionally created a template which had an undefined variable.
> 
>     <p>Hello ${c.name}${c.xxx}!</p>
...
> 
> I was expecting to have c.xxx turn into an empty string, and then the
> plan was to turn on strict mode and see if I got an AttributeError.
> Surprisingly, *before* I turned on strict mode, I got the
> AttributeError
> 
> AttributeError: 'ContextObj' object has no attribute 'xxx'
> 
> (http://pylonshq.com/tracebacks/f7d8cebed15956c453550f12812c3f4d).
> It's as if strict mode were already turned on.  Am I just confused
> about how this is all supposed to work?

The Pylons book describes Pylons 0.9.7.  You're probably using 1.0,
which has some backwards-incompatible changes:
http://pylonshq.com/docs/en/1.0/upgrading/

strict_tmpl_context (previously called strict_c) defaulting to True is
one of those changes.

Marius Gedminas
-- 
I'm a sorceress, not a miracle worker.
        -- The Spellsong War by L. E. Modesitt, Jr.

Attachment: signature.asc
Description: Digital signature

Reply via email to