django-ajax-validation
django-ajax-validation copied to clipboard
Allow async ajax calls and form class to be specified as string (URL argument).
I've written a patch that adds a semi-colon to the start of the JS so it can be included with other jquery plugins which might omit the closing semi-colon, adds async
param to the validate method so that events like keyup, blur and change can trigger validation in the background while input continues, adds method
param to the validate method so ajax validation can be used with GET method forms and views, allows form_class
to be specified as a string so you can pass it as a URL argument or hard coded path rather than having to import the form class into urls.py. I also cleaned up white space in a few places.
The patch is available at: http://paste.pocoo.org/show/153778/
I've updated the patch to fix incorrect usage of isinstance
(form_class should be a subclass of django.forms.Form
, not an instance) and also allow the form_class
argument to be a callable that returns a form class.
http://paste.pocoo.org/show/154019/
My bad, issubclass
raises a TypeError if passed a function. Updated the patch to use isinstance
and types.FunctionType
.
http://paste.pocoo.org/show/154043/
hi