``request.params`` is a dict.  FormEncode has a converter to transform

> a flat HTML namespace into nested dicts with sub-dicts and sub-lists.
> What else do "neat dictionaries" need?
>

That conversion works fine. And that could be a part of core html helpers.
What I would really like to borrow from Rails is the concept of models being
in charge of their own data validation. Is it a good move in theory? Perhaps
not. But after 3 years of Rails I am certain it works great in practice.

Rails achieves that by tightly coupling their views and models. Pylons is
more modular so that door's closed and it's fine. I, for one, can't come up
with anything smarter than FormEncode to have both validators + decoupled
views/models. And I still do all my validation manually in my models, i.e.
my form classes are just a boilerplate shim which connects model-based data
validation with HTML form parsing/generation. If I had more time to hack for
fun, I would definitely be looking at getting rid of them.

Cheers,
Ev


>
> If you don't use a class to specify what type each field should be and
> whether it's required, what would you use instead? One can do it with
> a dict and validation functions, but a class organizes the code
> better. And you probably want more specific error messages than,
> "ValueError: invalid literal for int() with base 10: 'A'".
>
> The thing with FormEncode is you can do a lot of things with it, and
> it's suitable for validating both form input, configurations, and
> other things. The proposed replacements (e.g., WTForms) add more magic
> (widget renderers), and are generally not as flexible as FormEncode,
> so we'd be losing some functionality, and forcing people into even
> more rigid classes.
>
> @validate is the root of all evil, and it's on the list of things to
> replace in the next Pylons version. (Well, not all evil. The vileness
> of StackedObjectProxies must not be ignored.)
>
> --
> Mike Orr <[email protected]>
>
> --
> 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]<pylons-discuss%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

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