Changeset 2472
- Timestamp:
- 03/02/06 04:05:09 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/core/management.py
r2470 r2472 848 848 rel_opts = f.rel.to._meta 849 849 if f.rel.to not in models.get_models(): 850 e.add(opts, "'%s' relates touninstalled model %s" % (f.name, rel_opts.object_name))850 e.add(opts, "'%s' has relation with uninstalled model %s" % (f.name, rel_opts.object_name)) 851 851 852 852 rel_name = RelatedObject(f.rel.to, cls, f).get_accessor_name() 853 853 for r in rel_opts.fields: 854 854 if r.name == rel_name: 855 e.add(opts, "'%s' accessor name '%s.%s' clashes with another field " % (f.name, rel_opts.object_name, r.name))855 e.add(opts, "'%s' accessor name '%s.%s' clashes with another field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.name, f.name)) 856 856 for r in rel_opts.many_to_many: 857 857 if r.name == rel_name: 858 e.add(opts, "'%s' accessor name '%s.%s' clashes with a m2m field " % (f.name, rel_opts.object_name, r.name))858 e.add(opts, "'%s' accessor name '%s.%s' clashes with a m2m field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.name, f.name)) 859 859 for r in rel_opts.get_all_related_many_to_many_objects(): 860 860 if r.get_accessor_name() == rel_name: 861 e.add(opts, "'%s' accessor name '%s.%s' clashes with a related m2m field " % (f.name, rel_opts.object_name, r.get_accessor_name()))861 e.add(opts, "'%s' accessor name '%s.%s' clashes with a related m2m field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name)) 862 862 for r in rel_opts.get_all_related_objects(): 863 863 if r.get_accessor_name() == rel_name and r.field is not f: 864 e.add(opts, "'%s' accessor name '%s.%s' clashes with a related field" % (f.name, rel_opts.object_name, r.get_accessor_name()))864 e.add(opts, "'%s' accessor name '%s.%s' clashes with another related field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name)) 865 865 866 866 for i, f in enumerate(opts.many_to_many): … … 874 874 for r in rel_opts.fields: 875 875 if r.name == rel_name: 876 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with another field " % (f.name, rel_opts.object_name, r.name))876 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with another field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.name, f.name)) 877 877 for r in rel_opts.many_to_many: 878 878 if r.name == rel_name: 879 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a m2m field " % (f.name, rel_opts.object_name, r.name))879 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a m2m field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.name, f.name)) 880 880 for r in rel_opts.get_all_related_many_to_many_objects(): 881 881 if r.get_accessor_name() == rel_name and r.field is not f: 882 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a related m2m field " % (f.name, rel_opts.object_name, r.get_accessor_name()))882 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a related m2m field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name)) 883 883 for r in rel_opts.get_all_related_objects(): 884 884 if r.get_accessor_name() == rel_name: 885 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with a related field" % (f.name, rel_opts.object_name, r.get_accessor_name()))885 e.add(opts, "'%s' m2m accessor name '%s.%s' clashes with another related field. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name)) 886 886 887 887 # Check admin attribute.
