Changes between Version 36 and Version 37 of NewformsHOWTO


Ignore:
Timestamp:
06/15/2008 02:22:54 PM (7 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewformsHOWTO

    v36 v37  
    526526== Q: How do I add custom validation? ==
    527527
    528 One option is to override ```form_add()``` and ```form_change()``` in ```ModelAdmin``` and provide a custom form that does the validation.
     528One option is to override ```get_form()``` in your ```ModelAdmin``` subclass and provide a custom form that does the validation.
    529529
    530530If you want custom validation for a field in the admin '''and''' newforms [http://www.djangoproject.com/documentation/modelforms/ ModelForm] instances you can subclass a field in your model and override ```formfield()```. You can then return the form field you like or a complete [http://www.djangoproject.com/documentation/newforms/#creating-custom-fields custom form field].
Back to Top