Changeset 3447
- Timestamp:
- 07/25/06 13:37:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/multiple-db-support/django/core/management.py
r3444 r3447 263 263 if not statements: 264 264 continue 265 if connection_name is _default:266 connection_name = '(default)'267 265 final_output.append(' -- The following statements are for connection: %s' % connection_name) 268 266 if reverse: … … 682 680 Returns number of errors. 683 681 """ 684 from django.db import models 682 from django.db import models, model_connection_name 685 683 from django.db.models.loading import get_app_errors 686 684 from django.db.models.fields.related import RelatedObject … … 693 691 for cls in models.get_models(app): 694 692 opts = cls._meta 695 693 connection_name = model_connection_name(cls) 694 696 695 # Do field-specific validation. 697 696 for f in opts.fields: … … 730 729 if f.rel.to not in models.get_models(): 731 730 e.add(opts, "'%s' has relation with model %s, which has not been installed" % (f.name, rel_opts.object_name)) 731 732 rel_connection = model_connection_name(f.rel.to) 733 if rel_connection != connection_name: 734 e.add(opts, "'%s' is configured to use connection '%s' but has relation with '%s', which is configured to use connection '%s'" % (cls.__name__, connection_name, f.rel.to.__name__, rel_connection)) 732 735 733 736 rel_name = RelatedObject(f.rel.to, cls, f).get_accessor_name()
