1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #8913 - Make "must be unique" error messages customisable. Thanks to Leah Culver.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Andrew Godwin
2011-06-09 15:05:13 +00:00
parent 7f6675a5fb
commit 865d684a8a
6 changed files with 35 additions and 5 deletions

View File

@@ -78,3 +78,7 @@ class FlexibleDatePost(models.Model):
slug = models.CharField(max_length=50, unique_for_year='posted', blank=True)
subtitle = models.CharField(max_length=50, unique_for_month='posted', blank=True)
posted = models.DateField(blank=True, null=True)
class UniqueErrorsModel(models.Model):
name = models.CharField(max_length=100, unique=True, error_messages={'unique': u'Custom unique name message.'})
number = models.IntegerField(unique=True, error_messages={'unique': u'Custom unique number message.'})