> <p py:if="has_permission('edit-posts')">
>       Congrats! You can edit blog posts.
> </p>
>
> This would of course always evaluate to true.


object.__nonzero__(self)

    Called to implement truth value testing, and the built-in
operation bool(); should return False or True, or their integer
equivalents 0 or 1. When this method is not defined, __len__() is
called, if it is defined (see below). If a class defines neither
__len__() nor __nonzero__(), all its instances are considered true.

Implementing __nonzero__ should eliminate the trap.
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to