I don't think it's goofy idea. Actually it is kind of what dojo.validate.check() does: it takes a form id and a profile object, which tells how to validate each field. Obviously the profile is generated by server depending on underlying data types. Django has all information available to generate it.
 
As I can see they support individual validations, some dependency validations, equality validations (double checks), and pre-filtering (e.g., trim whitespaces, upper/lowercase, and so on). So far it fits Django like a glove.
 
Thanks,
 
Eugene
 
"David Ascher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
On 11/16/05, Eugene Lazutkin <[EMAIL PROTECTED]> wrote:

> PS: There are some people in Dojo community, who work on form widget,
> which supports some validation mechanism. It would be nice to see what
> they do.

They do have some stuff to validate input. I found this file in their
repository:

http://dojotoolkit.org/trac/file/trunk/src/validate.js

It reminds me of:

http://code.djangoproject.com/browser/django/trunk/django/core/validators.py

Their code can validate individual values as well as all fields of the form
using some additonal meta-information.

Goofy idea: use the Python logic to generate JS code to do clientside validation based on the model-specified constraints.  Detailed specification and implementation are left as an exercise to the reader. ;-)

Reply via email to