1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

magic-removal: Changed model validator not to check for 'singular' on ManyToManyFields, because that's not going to be used anymore.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2243 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-02-03 20:01:58 +00:00
parent ce0c6887d6
commit b9c2b3e83f

View File

@ -861,13 +861,7 @@ def get_validation_errors(outfile):
elif rel_name in [r.OLD_get_accessor_name() for r in rel_opts.get_all_related_objects() if r.field is not f]:
e.add(opts, "'%s.%s' related field: Clashes with related field on '%s.%s'" % (opts.object_name, f.name, rel_opts.object_name, rel_name))
# Check for multiple ManyToManyFields to the same object, and
# verify "singular" is set in that case.
for i, f in enumerate(opts.many_to_many):
for previous_f in opts.many_to_many[:i]:
if f.rel.to._meta == previous_f.rel.to._meta and f.rel.singular == previous_f.rel.singular:
e.add(opts, 'The "%s" field requires a "singular" parameter, because the %s model has more than one ManyToManyField to the same model (%s).' % (f.name, opts.object_name, previous_f.rel.to._meta.object_name))
# Check to see if the related m2m field will clash with any
# existing fields, m2m fields, m2m related objects or related objects
if f.rel: