e.add(opts, "Reverse query name for field '%s' clashes with related field '%s.%s'. Add a related_name argument to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name))

e.add(opts, "%s has a manually-defined m2m relationship through a model (%s) which does not exist." % (f.name, f.rel.through))

125

else:

126

signature = (f.rel.to, cls, intermediary_model)

127

if signature in seen_intermediary_signatures:

128

e.add(opts, "%s has two manually defined m2m relationships through the same model (%s), which is not possible. Please use a field on your intermediary model instead." % (cls._meta.object_name, intermediary_model._meta.object_name))

129

else:

130

seen_intermediary_signatures.append(signature)

131

seen_related_fk, seen_this_fk = False, False

132

for field in intermediary_model._meta.fields:

133

if field.rel:

134

if field.rel.to == f.rel.to:

135

seen_related_fk = True

136

elif field.rel.to == cls:

137

seen_this_fk = True

138

if not seen_related_fk or not seen_this_fk:

139

e.add(opts, "%s has a manualy-defined m2m relationship through a model (%s) which does not have foreign keys to %s and %s" % (f.name, f.rel.through, f.rel.to._meta.object_name, cls._meta.object_name))