e.add(opts,"'%s' defines a relation with the model '%s.%s', which has been swapped out. Update the relation to point at settings.%s."%(f.name,f.rel.to._meta.app_label,f.rel.to._meta.object_name,f.rel.to._meta.swappable))
else:
e.add(opts,"'%s' has a relation with model %s, which has either not been installed or is abstract."%(f.name,f.rel.to))
# it is a string and we could not find the model it refers to
# so skip the next section
ifisinstance(f.rel.to,six.string_types):
continue
# Make sure the model we're related hasn't been swapped out
iff.rel.to._meta.swapped:
e.add(opts,"'%s' defines a relation with the model '%s.%s', which has been swapped out. Update the relation to point at settings.%s."%(f.name,f.rel.to._meta.app_label,f.rel.to._meta.object_name,f.rel.to._meta.swappable))
# Make sure the related field specified by a ForeignKey is unique
e.add(opts,"'%s' defines a relation with the model '%s.%s', which has been swapped out. Update the relation to point at settings.%s."%(f.name,f.rel.to._meta.app_label,f.rel.to._meta.object_name,f.rel.to._meta.swappable))
else:
e.add(opts,"'%s' has an m2m relation with model %s, which has either not been installed or is abstract."%(f.name,f.rel.to))
# it is a string and we could not find the model it refers to
# so skip the next section
ifisinstance(f.rel.to,six.string_types):
continue
# Make sure the model we're related hasn't been swapped out
iff.rel.to._meta.swapped:
e.add(opts,"'%s' defines a relation with the model '%s.%s', which has been swapped out. Update the relation to point at settings.%s."%(f.name,f.rel.to._meta.app_label,f.rel.to._meta.object_name,f.rel.to._meta.swappable))
# Check that the field is not set to unique. ManyToManyFields do not support unique.
iff.unique:
e.add(opts,"ManyToManyFields cannot be unique. Remove the unique argument on '%s'."%f.name)