I've used wtforms a little and I think it is pretty great. Code base is very clean and small and it also offers an immediate alternative to @validate (and htmlfill). It does include html generation through python class-based widgets (vs mako style widgets), but it still lends ample flexibility when doing so.
FormEncode is great too, but also seems more complex. I often find myself wondering if I'm sub-classing the right thing or overriding the right methods in my custom validators. For example, when subclassing FormValidator, you override .validate(), when subclassing FancyValidator you do ._to_python(). But you can also have a FancyValidator subclass act as a form validator if it is run in chained_validators. There so many ways to do things, I'm just not sure if I'm doing any of them right. Of course, my understanding of FormEncode could be completely wrong! On Jan 10, 9:42 pm, Mike Orr <[email protected]> wrote: > On Sun, Jan 10, 2010 at 3:27 PM, Chris <[email protected]> wrote: > > One more alternative I forgot to mention about form handling: > >http://marcuscavanaugh.com/posts/pylons-django-forms/ > > A few people have mentioned using django.forms with Pylons and have > been pleased with it. There's another project WTForms which is > similar and doesn't depend on Django. > > We considered replacing FormEncode with WTForms in Pylons, but > FormEncode is incredibly flexible because it only tries to do one > thing, and we didn't want to lose its functionality in edge cases. For > instance, I use it to validate my INI dict and convert the values. You > could do that with WTForms but the code is so HTML-centric it feels > funny. The FormEncode situation will improve when I have time to write > a better manual (after I finish the WebHelpers docs), and after we > come up with something better than @validate. > > -- > 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]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
