vegetax wrote:
> Validation integration , the second most cumbersome thing when coding
> websystems,webapps. Interface coding being the hardest.
>
> I took a look at the upcoming Widgets framework, while it looked good
> you have to put the validators on the widgets? imo this is not the
> right place! , it goes compeltly against DRY, you are repeating a lot
> of stuff there is already in the model. not_null, unique, IntCol, etc.
>
> Why not link the validators to the model ?
>
> class Person(SQLObject):
>     name = StringCol(notNone=True, validators=[my_validator])
>     phone = IntCol(notNone=True, unique=True,
> validators=[my_Validator2, my_validator3])
>
> the something like:
>
> person.parse()
>
> which will return a parsed object that form widgets can understand and
> redisplay in case of errors, that way there is no need to repeat things
> 10 times, thats what makes changing,extending the app so dificult and
> cumbersome.
That I think depends on the kind of app we are talking about. I use
similar scheme when I need CRUD style forms(i.e. no intermediate
processing needed). But for complex apps, what is in the form are
usually not taken directly into the model but lots of processing is
needed(presentation vs storage). In that case, I don't see a problem of
DRY.

Reply via email to