|Version 3 (modified by 9 years ago) (diff),|
Part of DjangoSpecifications
Media and validation in newforms-admin
Customizing the admin should be possible by specifying an extension form for the admin class, preferrably with a class field:
class FooAdmin(admin.ModelAdmin): admin_form = FooAdminForm. Overriding
get_form() is equally acceptable.
- Specifying this custom form should not disable automatic widgets
class FooAdminForm(forms.BaseForm): media = forms.Media(js = ['/site_media/js/tiny_mce/tiny_mce.js'])
- Custom validation should be possible with the ordinary
clean()overrides in the custom form and should not interfere with base field validation.