Have you got strict_c set to False?
http://wiki.pylonshq.com/pages/viewpage.action?pageId=11174779#What%27snewinPylons0.9.7?-ImplicitBehaviorchanges

On Mon, Jan 19, 2009 at 12:19 PM, mk <[email protected]> wrote:

>
>
> In interactive debugger:
>
>  >>> hasattr(c,'name')
> True
>  >>> hasattr(c,'nafssadffa')
> True
>
> Huh? Why does hasattr return True for attributes that clearly don't
> exist in c?
>
> On related note, how to check for existence of attributes in c in
> templates? I want to do smth like:
>
> %if c.hasattr('name'):
>  c.name has no attribute 'name'
> %else:
>  c.name has attribute ${c.name}
> %endif
>
> Regards,
> mk
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to