On Mar 10, 6:24 pm, Christoph Zwerschke <[email protected]> wrote:
> Bruce Webber schrieb:
>
> > In a TG2 controller method I'm trying to write code like:
>
> >     from repoze.what import predicates
>
> >     # ...
>
> >         if (predicates.has_permission('view_convention')):
> >             # do somethng here
>
> > but this doesn't work. has_permission() evaluates to True, because it
> > returns an object:
>
> >     <repoze.what.predicates.has_permission object at 0x2080290>
>
> In the current versions of TG2/repoze.what, this should work as you
> expect - predicates are now evaluated as booleans.
>
> -- Christoph

Thanks, Christoph. I installed a fresh copy of TG 2.0b7 (into a
virtual environment) and my code worked.

For some reason upgrading TG from 2.0b5 to 2.0b7 with the command:

    easy_install -U -i http://www.turbogears.org/2.0/downloads/current/index
tg.devtools

did not work - some components remained at version 2.0b5.

-- Bruce

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to