Skip to content

Instantly share code, notes, and snippets.

@chriskief

chriskief/model.py

Created Nov 20, 2013
Embed
What would you like to do?
def unique_error_message(self, model_class, unique_check):
if model_class == type(self) and unique_check == ('field1', 'field2'):
return 'Your custom error message.'
else:
return super(YourModel, self).unique_error_message(model_class, unique_check)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment