3
3
3ds2012-02-20 10:34:21
Django
3ds, 2012-02-20 10:34:21

django modelform field replace standard error message in all fields

The task is this: django returns "Required field." if the field is required and not filled. How to make it so that in all forms it is acceptable instead of "Required field." was "this field must be filled"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
igorakintev, 2012-02-20
@igorakintev

first thought...)
{% if form.field.error='Required field' %}this field must be filled in{% endif %}

I
igorakintev, 2014-03-13
@igorakintev

email = forms.EmailField(label='Email', required=False, error_messages={'required': 'This field must be filled in.'})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question