I‘m a newer in python,django
model:
class Product(model.Model):
name = models.CharField(max_length = 30)
warehouse = models.CharField(max_length = 30)
class Meat:
unique_together = (('name', 'warehouse'),)
When i submit the form
if the name input field is empty,then I got the message : the field is……
if the name field value and the warehouse field value is equal, then I got the message: …is exist
How can I customize the validation error message(the stronger text)?
You can override error messages in the form:
Take a look at the django forms source to see the different error messages you can over ride.
https://github.com/django/django/blob/master/django/forms/fields.py