Reputation: 3236
is there a way to replace the default error message in django admin. I'm using custom widget so I have the form and I was wondering is there something like:
field_1 = forms.Charfield(widget=X, error_messge='y')
I already tried to add claen_field_1 method but it looks that it is not called when the field is empty. Any ideas will be appreciated
Upvotes: 6
Views: 3406
Reputation: 17186
yes there is and actually this is forms functionality and not admin functionality ;), you can use this anywhere.
field_1 = forms.Charfield(widget=X, error_messages={'required': 'y'})
for more information see the django docs
Upvotes: 8