Hi,

I read http://docs.turbogears.org/1.0/ValidateDecorator and http://docs.turbogears.org/1.0/ErrorHandling and have a basic understanding of the presented examples such as:
    @expose()
    @error_handler(index)
    @validate(validators={"number":v.Int})
    def validated_number(self, number=2):
        """displays an Integer (only)"""
        return dict(valid_number=number)

Now I want to use that in my app. It has to work with Python 2.3 which should be supported by TurboGears. There are plenty of examples for the expose decorator, e.g.
A)    validated_number = turbogears.expose()(validated_number)
B)    [expose()]

As A does not seem to work with multiple decorators, I tried B, e.g.
    [expose(), error_handler(error), validate(validators={"number":v.Int})]

Unfortunately, this results in a NotImplementedError if the value does not pass the validation:
 File "/usr/lib/python2.4/site-packages/turbogears/errorhandling.py", line 103, 
in
 run_with_errors
    raise NotImplementedError("Method %s.%s() has no applicable "
 NotImplementedError: Method Root.create() has no applicable error handler.

I'm probably missing something. All hints appreciated!
fs

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