I was running through the creating a form with ToscaWidgets tutorial
for TG2, and when I got to the validate part of the tutorial, I kept
on running into an error with the @validate line.  The @validate line
is the following:

    @validate(create_movie_form, error_handler=new_movie)

However, it complained that it couldn't find create_movie_form, even
through create_movie_form was declared in the same file (root.py) as
described in the tutorial:

create_movie_form = MovieForm("create_movie_form",
action='submit_movie', submit_text = 'Add movie')

I thought that maybe it was an ordering thing, so I moved the
declaration of create_movie_form to earlier in the file, before the
use of @validate, and this resolved the problems with @validate.

In general, order doesn't really matter much in Python source code
with respect to class declarations and the like, but it does seem to
make a difference with the @validate decorator.  Is this the expected
behavior for a decorator like @validate, or should it be considered a
bug?

Thanks,
Aaron Levinson
--~--~---------~--~----~------------~-------~--~----~
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