I'm using Django 1.2.4. I have a model that has a field that needs to be validated. When validation fails, I'd like to display a custom error message to the user. Model editing is done in the admin interface.
This is what I'm doing currently:
def clean_fields(self, exclude=None):
# do validation
if problem:
raise ValidationError({'field_name': "error message"})
Unfortunately, all this does is print out a separate validation message on the admin page for each character in the value of field_name.
What is the proper way to signal the error message I want?