[ZODB-Dev] Pre-announce: Oscar 0.1

Greg Ward gward@mems-exchange.org
Tue, 4 Sep 2001 14:58:17 -0400


On 02 September 2001, Christian Robottom Reis said:
> Sure, but it's ready and implemented there, isn't it? Or do you suggest I
> could use the same descriptive format for another tool I would right that
> could use Grouch's parser?

Good point.  I was thinking from the point-of-view of Grouch's
implementor.  If all I wanted was something to validate user input, I
wouldn't have come up with Grouch.  Now that Grouch exists, though, you
might as well use it for something other than its original purpose.

> How do you process and validate user input in your project?

Two words: typed widgets.

Philosophy: the UI should constrain the user as much as it can to make
sure they enter the right stuff.  The code that does that constraining
should be as close to the user as possible, in order to make error
reports as useful to the user as possible.  Since our application is a
web application, we have classes corresponding to all the major
"widgets" you can have in an HTML form.  We subclass those for
type-related constraints, eg. a string input box that requires integers.
Some widgets are inherently value-constrained -- eg. radio buttons and
select lists -- so our widget classes let you specify a constraint.
Others are inherently unconstrained (text areas, string entry, or string
entry that only accepts integers), and our widget classes leave them
as-is.

The particular implementation we use -- the Quixote Form Library -- will
be part of Quixote 0.4.  (Quixote is the web application development
tool we developed after abandoning Zope.)

I imagine you could cook up a similar toolkit for GUI development in
Python; the ideas from the Quixote Form Library are sound, and you are
welcome to steal them.  The implementation is highly web-centric,
though.  I would be surprised to learn nobody has already implemented
such a library, though.

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org