On Mar 23, 4:57 pm, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
> At the moment you get all four in one decorator. If you want a subset of
> them you have to code the whole thing yourself. I'm not sure what the
> best way to make that more modular - we don't want to make the common
> case more complex for developers. Making the last part optional feels
> like a safe change to me: there are very good reasons to skip or do
> custom output transformation, while there appear to be enough options
> already to manage the first three.

Let me explain a use case for my intention:

you have a formencode schema/class, it validates fine on the user
input
during the 'successful' form submission, any of the following happens:
    - the validation is no longer valid because of some transactional/
temporal element
    - you run into some db error or applicaiton logic error

due to the way the validator decorator is implemented (validation +
error handing in one), the form entered data is essentially lost

by splitting up the validation + error , one could then ( after the
validator says 'ok' ) simply do:
   self.form_errors[field]= 'crap'
   return self.form_error_render()

or something like that... which would then merge the app originated
errors with the form printing/automation


> That sounds like something that really should be a validator error.
ideally, yes.  but formencode/validator does not play nicely with
multi-field , chained, or db-hitting validation.  what would be 3
lines of procedural coding becomes 30 lines of single-use OOP classes
and methods

> the validate decorator is part of pylons, not formencode. And validator
> is trying to work for you, but goes a bit too far in all its enthousiasm.

validator is EXTREMELY hard to work with.   in order to use formencode
for certain things you often have to work harder.

it makes SIMPLE forms very easy.  it makes 'complex' forms incredibly
difficult
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to