KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I can see how to add an error message to a field when using forms, but what about model form? This is my test model: class Author(models.Model): first_name = models.CharField(max_length=125) last_name = models.CharField(max_length=125) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) My model form: class AuthorForm(forms.ModelForm): class Meta: model = Author The error message on the fields: first_name and last_name is: This field is required How do I change that in a model form?
Tags (comma-separated)
Save Edits
Cancel