[Grok-dev] ZTK and zopeapp

Hanno Schlichting hanno at hannosch.eu
Wed Dec 30 12:15:28 EST 2009


On Wed, Dec 30, 2009 at 5:59 PM, Souheil CHELFOUH <trollfot at gmail.com> wrote:
> Well, about the formlib, yes and no.
> Some would say z3c.forms libs are richer and better.
> After working with it, I wouldn't say that.

z3c.form was only developed after formlib existed for a while,
specifically to address some of the shortcomings in formlib. But it
did so with a clear focus on being used by advanced developers.

> I first thought it was the way to go, but, I find it now too heavy and
> too complex.

That concern is shared by many more users of z3c.form. I think
z3c.form is good when dealing with forms for things which are clearly
defined by a schema and there's not too much difference between that
schema and the way you want to present it to the user.

If on the other hand you have a form which isn't really schema-ish, I
think a form library that wants to construct the entire form or even
offers widgets is probably more of a hassle than it helps.

Take a very simple login form for example. It's probably only two text
fields and a submit button. You can express that as a schema, and have
a text and password field. But then you want to add that bit of
JavaScript checking if caps-lock is pressed, have some checks for
cookies being enabled (so the user can actually log in), support login
via OpenID and normal user names and so forth.

At that point the overhead of the form library doesn't pay off
anymore. In some cases you still might want to have some help with
form data conversion (a group of checkboxes turn into some dict of
booleans for example) and validation. But the whole form construction
is something that HTML and JavaScript libraries are actually better
at.

Hanno


More information about the Grok-dev mailing list