diff options
| author | Marc Egli <frog32@me.com> | 2014-04-14 14:41:47 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2014-04-14 16:49:40 -0400 |
| commit | 0bcc92c6917738caa2f08ec16d26fad62974fb47 (patch) | |
| tree | e144e332202a3b63b623bc05716fcb522028ffb3 /django | |
| parent | 17c18844561431aabed89c3bd48de951db7d13ab (diff) | |
Fixed #22356 -- Added a check to make sure unique_together fields are local.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index 589d793627..b978d9ebdf 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1346,6 +1346,19 @@ class Model(six.with_metaclass(ModelBase)): id='models.E013', ) ) + elif field not in cls._meta.local_fields: + errors.append( + checks.Error( + ("'%s' refers to field '%s' which is not local " + "to model '%s'.") % ( + option, field_name, cls._meta.object_name + ), + hint=("This issue may be caused by multi-table " + "inheritance."), + obj=cls, + id='models.E016', + ) + ) return errors @classmethod |
