I have several controller methods which share a common structure.  That
structure is:

if entity doesn't exist: present a form to create entity
if entity does exist: present form pre-filled so user can change
attributes.

Now, this is straight forward to model, however, how should validation
be handled?

Since validation is handled by a decorator:
@tg.validate(form=group_form)
@tg.validate(form=user_form)
...

the controller method is pre-set to validate based on a single form.
However, obviously the form will vary as the type of the entity.

Is there a way to vary at runtime how the form is validated, since the
type of form to be presented is determined by looking at the parameters
passed to the controller method which is itself decorated with the
validation info?


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

Reply via email to