1
0
mirror of https://github.com/django/django.git synced 2024-12-26 11:06:07 +00:00

Small formatting change to validation error in [516], to be consistent with other validation errors.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-16 18:28:00 +00:00
parent 7d374ad597
commit f21ff30b10

View File

@ -603,8 +603,10 @@ class ManyToManyField(Field):
objects = mod.get_in_bulk(pks)
if len(objects) != len(pks):
badkeys = [k for k in pks if k not in objects]
raise validators.ValidationError, "Please enter valid %s IDs (the value%s %r %s invalid)" % \
(self.verbose_name, len(badkeys) > 1 and 's' or '', len(badkeys) == 1 and badkeys[0] or tuple(badkeys), len(badkeys) == 1 and "is" or "are")
raise validators.ValidationError, "Please enter valid %s IDs. The value%s %r %s invalid." % \
(self.verbose_name, len(badkeys) > 1 and 's' or '',
len(badkeys) == 1 and badkeys[0] or tuple(badkeys),
len(badkeys) == 1 and "is" or "are")
class OneToOneField(IntegerField):
def __init__(self, to, to_field=None, rel_name=None, **kwargs):