views:

31

answers:

1

Hi,

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

+1  A: 

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

KillianDS
Great, thanks )
Ilian Iliev