Hi,

I just encountered the same issues as discussed here:

http://groups.google.com/group/turbogears/browse_thread/thread/d8a8af2b60a65714/40bc1b97141b03b8

The discussion is a bit roved, yet it seems that the consensus is: In case of 
a validation-error, don't pass partially validated parameters to the 
error_handler.

I agree with the reasoning - however, I'd like to propose an enhancement to 
TG2. I currently have the following situation:


@expose(template)
@validate(dict(project=ModelValidator(Project))
def view(self, project=None):
      # do something based on project, including
      # rendering a form (potentially with errors)
      # that contains project as hidden field.

@expose()
@validate(some_form, error_handler=view)
def do_something(self, **params):
    ....

Now what I'd like to have is a "convert" decorator (suggest a better name if 
you like) that takes the same arguments as a validate-decorator except the 
error-handler. It performs the same validation, and any validation error is 
a "real" application error. But it will *always* run, regardless of previous 
validation attempts.

It makes sense I'd say because one doesn't care about actual validation for 
cases like displaying some model objects, but still you need your parameters 
being converted to python.

I will write this for my own usage - question is: do you think this would be a 
worthy addition to the shipped decorators?

Diez

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