On 03/01/2011 18:03, nh2 wrote:
How would you write a decorator that checks a predicate (e.g. a
MY_FEATURE_ENABLED=False bool in the configuration or
does_this_feature_work_today() function) and based on that executes
the controller or throws something like HTTP 501 Not implemented or
whatever custom error?

Is something like this already there in Turbogears 2.1?

You're looking for repoze.who and repoze.what. Write your own custom predicates and use them with the decorators here: http://pylonshq.com/snippets/repozewhat_authorization_decorators_for_pylons

--
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