PageRenderTime 43ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/modeltests/invalid_models/invalid_models/models.py

https://code.google.com/p/mango-py/
Python | 341 lines | 272 code | 53 blank | 16 comment | 0 complexity | aba9f62ec57155561ab8cd35468017c1 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. #encoding=utf-8
  2. """
  3. 26. Invalid models
  4. This example exists purely to point out errors in models.
  5. """
  6. from django.db import models
  7. class FieldErrors(models.Model):
  8. charfield = models.CharField()
  9. charfield2 = models.CharField(max_length=-1)
  10. charfield3 = models.CharField(max_length="bad")
  11. decimalfield = models.DecimalField()
  12. decimalfield2 = models.DecimalField(max_digits=-1, decimal_places=-1)
  13. decimalfield3 = models.DecimalField(max_digits="bad", decimal_places="bad")
  14. decimalfield4 = models.DecimalField(max_digits=9, decimal_places=10)
  15. decimalfield5 = models.DecimalField(max_digits=10, decimal_places=10)
  16. filefield = models.FileField()
  17. choices = models.CharField(max_length=10, choices='bad')
  18. choices2 = models.CharField(max_length=10, choices=[(1,2,3),(1,2,3)])
  19. index = models.CharField(max_length=10, db_index='bad')
  20. field_ = models.CharField(max_length=10)
  21. nullbool = models.BooleanField(null=True)
  22. class Target(models.Model):
  23. tgt_safe = models.CharField(max_length=10)
  24. clash1 = models.CharField(max_length=10)
  25. clash2 = models.CharField(max_length=10)
  26. clash1_set = models.CharField(max_length=10)
  27. class Clash1(models.Model):
  28. src_safe = models.CharField(max_length=10)
  29. foreign = models.ForeignKey(Target)
  30. m2m = models.ManyToManyField(Target)
  31. class Clash2(models.Model):
  32. src_safe = models.CharField(max_length=10)
  33. foreign_1 = models.ForeignKey(Target, related_name='id')
  34. foreign_2 = models.ForeignKey(Target, related_name='src_safe')
  35. m2m_1 = models.ManyToManyField(Target, related_name='id')
  36. m2m_2 = models.ManyToManyField(Target, related_name='src_safe')
  37. class Target2(models.Model):
  38. clash3 = models.CharField(max_length=10)
  39. foreign_tgt = models.ForeignKey(Target)
  40. clashforeign_set = models.ForeignKey(Target)
  41. m2m_tgt = models.ManyToManyField(Target)
  42. clashm2m_set = models.ManyToManyField(Target)
  43. class Clash3(models.Model):
  44. src_safe = models.CharField(max_length=10)
  45. foreign_1 = models.ForeignKey(Target2, related_name='foreign_tgt')
  46. foreign_2 = models.ForeignKey(Target2, related_name='m2m_tgt')
  47. m2m_1 = models.ManyToManyField(Target2, related_name='foreign_tgt')
  48. m2m_2 = models.ManyToManyField(Target2, related_name='m2m_tgt')
  49. class ClashForeign(models.Model):
  50. foreign = models.ForeignKey(Target2)
  51. class ClashM2M(models.Model):
  52. m2m = models.ManyToManyField(Target2)
  53. class SelfClashForeign(models.Model):
  54. src_safe = models.CharField(max_length=10)
  55. selfclashforeign = models.CharField(max_length=10)
  56. selfclashforeign_set = models.ForeignKey("SelfClashForeign")
  57. foreign_1 = models.ForeignKey("SelfClashForeign", related_name='id')
  58. foreign_2 = models.ForeignKey("SelfClashForeign", related_name='src_safe')
  59. class ValidM2M(models.Model):
  60. src_safe = models.CharField(max_length=10)
  61. validm2m = models.CharField(max_length=10)
  62. # M2M fields are symmetrical by default. Symmetrical M2M fields
  63. # on self don't require a related accessor, so many potential
  64. # clashes are avoided.
  65. validm2m_set = models.ManyToManyField("self")
  66. m2m_1 = models.ManyToManyField("self", related_name='id')
  67. m2m_2 = models.ManyToManyField("self", related_name='src_safe')
  68. m2m_3 = models.ManyToManyField('self')
  69. m2m_4 = models.ManyToManyField('self')
  70. class SelfClashM2M(models.Model):
  71. src_safe = models.CharField(max_length=10)
  72. selfclashm2m = models.CharField(max_length=10)
  73. # Non-symmetrical M2M fields _do_ have related accessors, so
  74. # there is potential for clashes.
  75. selfclashm2m_set = models.ManyToManyField("self", symmetrical=False)
  76. m2m_1 = models.ManyToManyField("self", related_name='id', symmetrical=False)
  77. m2m_2 = models.ManyToManyField("self", related_name='src_safe', symmetrical=False)
  78. m2m_3 = models.ManyToManyField('self', symmetrical=False)
  79. m2m_4 = models.ManyToManyField('self', symmetrical=False)
  80. class Model(models.Model):
  81. "But it's valid to call a model Model."
  82. year = models.PositiveIntegerField() #1960
  83. make = models.CharField(max_length=10) #Aston Martin
  84. name = models.CharField(max_length=10) #DB 4 GT
  85. class Car(models.Model):
  86. colour = models.CharField(max_length=5)
  87. model = models.ForeignKey(Model)
  88. class MissingRelations(models.Model):
  89. rel1 = models.ForeignKey("Rel1")
  90. rel2 = models.ManyToManyField("Rel2")
  91. class MissingManualM2MModel(models.Model):
  92. name = models.CharField(max_length=5)
  93. missing_m2m = models.ManyToManyField(Model, through="MissingM2MModel")
  94. class Person(models.Model):
  95. name = models.CharField(max_length=5)
  96. class Group(models.Model):
  97. name = models.CharField(max_length=5)
  98. primary = models.ManyToManyField(Person, through="Membership", related_name="primary")
  99. secondary = models.ManyToManyField(Person, through="Membership", related_name="secondary")
  100. tertiary = models.ManyToManyField(Person, through="RelationshipDoubleFK", related_name="tertiary")
  101. class GroupTwo(models.Model):
  102. name = models.CharField(max_length=5)
  103. primary = models.ManyToManyField(Person, through="Membership")
  104. secondary = models.ManyToManyField(Group, through="MembershipMissingFK")
  105. class Membership(models.Model):
  106. person = models.ForeignKey(Person)
  107. group = models.ForeignKey(Group)
  108. not_default_or_null = models.CharField(max_length=5)
  109. class MembershipMissingFK(models.Model):
  110. person = models.ForeignKey(Person)
  111. class PersonSelfRefM2M(models.Model):
  112. name = models.CharField(max_length=5)
  113. friends = models.ManyToManyField('self', through="Relationship")
  114. too_many_friends = models.ManyToManyField('self', through="RelationshipTripleFK")
  115. class PersonSelfRefM2MExplicit(models.Model):
  116. name = models.CharField(max_length=5)
  117. friends = models.ManyToManyField('self', through="ExplicitRelationship", symmetrical=True)
  118. class Relationship(models.Model):
  119. first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set")
  120. second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set")
  121. date_added = models.DateTimeField()
  122. class ExplicitRelationship(models.Model):
  123. first = models.ForeignKey(PersonSelfRefM2MExplicit, related_name="rel_from_set")
  124. second = models.ForeignKey(PersonSelfRefM2MExplicit, related_name="rel_to_set")
  125. date_added = models.DateTimeField()
  126. class RelationshipTripleFK(models.Model):
  127. first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set_2")
  128. second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set_2")
  129. third = models.ForeignKey(PersonSelfRefM2M, related_name="too_many_by_far")
  130. date_added = models.DateTimeField()
  131. class RelationshipDoubleFK(models.Model):
  132. first = models.ForeignKey(Person, related_name="first_related_name")
  133. second = models.ForeignKey(Person, related_name="second_related_name")
  134. third = models.ForeignKey(Group, related_name="rel_to_set")
  135. date_added = models.DateTimeField()
  136. class AbstractModel(models.Model):
  137. name = models.CharField(max_length=10)
  138. class Meta:
  139. abstract = True
  140. class AbstractRelationModel(models.Model):
  141. fk1 = models.ForeignKey('AbstractModel')
  142. fk2 = models.ManyToManyField('AbstractModel')
  143. class UniqueM2M(models.Model):
  144. """ Model to test for unique ManyToManyFields, which are invalid. """
  145. unique_people = models.ManyToManyField(Person, unique=True)
  146. class NonUniqueFKTarget1(models.Model):
  147. """ Model to test for non-unique FK target in yet-to-be-defined model: expect an error """
  148. tgt = models.ForeignKey('FKTarget', to_field='bad')
  149. class UniqueFKTarget1(models.Model):
  150. """ Model to test for unique FK target in yet-to-be-defined model: expect no error """
  151. tgt = models.ForeignKey('FKTarget', to_field='good')
  152. class FKTarget(models.Model):
  153. bad = models.IntegerField()
  154. good = models.IntegerField(unique=True)
  155. class NonUniqueFKTarget2(models.Model):
  156. """ Model to test for non-unique FK target in previously seen model: expect an error """
  157. tgt = models.ForeignKey(FKTarget, to_field='bad')
  158. class UniqueFKTarget2(models.Model):
  159. """ Model to test for unique FK target in previously seen model: expect no error """
  160. tgt = models.ForeignKey(FKTarget, to_field='good')
  161. class NonExistingOrderingWithSingleUnderscore(models.Model):
  162. class Meta:
  163. ordering = ("does_not_exist",)
  164. class InvalidSetNull(models.Model):
  165. fk = models.ForeignKey('self', on_delete=models.SET_NULL)
  166. class InvalidSetDefault(models.Model):
  167. fk = models.ForeignKey('self', on_delete=models.SET_DEFAULT)
  168. class UnicodeForeignKeys(models.Model):
  169. """Foreign keys which can translate to ascii should be OK, but fail if they're not."""
  170. good = models.ForeignKey(u'FKTarget')
  171. also_good = models.ManyToManyField(u'FKTarget', related_name='unicode2')
  172. # In Python 3 this should become legal, but currently causes unicode errors
  173. # when adding the errors in core/management/validation.py
  174. #bad = models.ForeignKey(u'รข˜…')
  175. model_errors = """invalid_models.fielderrors: "charfield": CharFields require a "max_length" attribute that is a positive integer.
  176. invalid_models.fielderrors: "charfield2": CharFields require a "max_length" attribute that is a positive integer.
  177. invalid_models.fielderrors: "charfield3": CharFields require a "max_length" attribute that is a positive integer.
  178. invalid_models.fielderrors: "decimalfield": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
  179. invalid_models.fielderrors: "decimalfield": DecimalFields require a "max_digits" attribute that is a positive integer.
  180. invalid_models.fielderrors: "decimalfield2": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
  181. invalid_models.fielderrors: "decimalfield2": DecimalFields require a "max_digits" attribute that is a positive integer.
  182. invalid_models.fielderrors: "decimalfield3": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
  183. invalid_models.fielderrors: "decimalfield3": DecimalFields require a "max_digits" attribute that is a positive integer.
  184. invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
  185. invalid_models.fielderrors: "decimalfield5": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
  186. invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
  187. invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
  188. invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
  189. invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
  190. invalid_models.fielderrors: "index": "db_index" should be either None, True or False.
  191. invalid_models.fielderrors: "field_": Field names cannot end with underscores, because this would lead to ambiguous queryset filters.
  192. invalid_models.fielderrors: "nullbool": BooleanFields do not accept null values. Use a NullBooleanField instead.
  193. invalid_models.clash1: Accessor for field 'foreign' clashes with field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
  194. invalid_models.clash1: Accessor for field 'foreign' clashes with related m2m field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
  195. invalid_models.clash1: Reverse query name for field 'foreign' clashes with field 'Target.clash1'. Add a related_name argument to the definition for 'foreign'.
  196. invalid_models.clash1: Accessor for m2m field 'm2m' clashes with field 'Target.clash1_set'. Add a related_name argument to the definition for 'm2m'.
  197. invalid_models.clash1: Accessor for m2m field 'm2m' clashes with related field 'Target.clash1_set'. Add a related_name argument to the definition for 'm2m'.
  198. invalid_models.clash1: Reverse query name for m2m field 'm2m' clashes with field 'Target.clash1'. Add a related_name argument to the definition for 'm2m'.
  199. invalid_models.clash2: Accessor for field 'foreign_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
  200. invalid_models.clash2: Accessor for field 'foreign_1' clashes with related m2m field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
  201. invalid_models.clash2: Reverse query name for field 'foreign_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
  202. invalid_models.clash2: Reverse query name for field 'foreign_1' clashes with related m2m field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
  203. invalid_models.clash2: Accessor for field 'foreign_2' clashes with related m2m field 'Target.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
  204. invalid_models.clash2: Reverse query name for field 'foreign_2' clashes with related m2m field 'Target.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
  205. invalid_models.clash2: Accessor for m2m field 'm2m_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
  206. invalid_models.clash2: Accessor for m2m field 'm2m_1' clashes with related field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
  207. invalid_models.clash2: Reverse query name for m2m field 'm2m_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
  208. invalid_models.clash2: Reverse query name for m2m field 'm2m_1' clashes with related field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
  209. invalid_models.clash2: Accessor for m2m field 'm2m_2' clashes with related field 'Target.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
  210. invalid_models.clash2: Reverse query name for m2m field 'm2m_2' clashes with related field 'Target.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
  211. invalid_models.clash3: Accessor for field 'foreign_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
  212. invalid_models.clash3: Accessor for field 'foreign_1' clashes with related m2m field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
  213. invalid_models.clash3: Reverse query name for field 'foreign_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
  214. invalid_models.clash3: Reverse query name for field 'foreign_1' clashes with related m2m field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
  215. invalid_models.clash3: Accessor for field 'foreign_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
  216. invalid_models.clash3: Accessor for field 'foreign_2' clashes with related m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
  217. invalid_models.clash3: Reverse query name for field 'foreign_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
  218. invalid_models.clash3: Reverse query name for field 'foreign_2' clashes with related m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
  219. invalid_models.clash3: Accessor for m2m field 'm2m_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
  220. invalid_models.clash3: Accessor for m2m field 'm2m_1' clashes with related field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
  221. invalid_models.clash3: Reverse query name for m2m field 'm2m_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
  222. invalid_models.clash3: Reverse query name for m2m field 'm2m_1' clashes with related field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
  223. invalid_models.clash3: Accessor for m2m field 'm2m_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
  224. invalid_models.clash3: Accessor for m2m field 'm2m_2' clashes with related field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
  225. invalid_models.clash3: Reverse query name for m2m field 'm2m_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
  226. invalid_models.clash3: Reverse query name for m2m field 'm2m_2' clashes with related field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
  227. invalid_models.clashforeign: Accessor for field 'foreign' clashes with field 'Target2.clashforeign_set'. Add a related_name argument to the definition for 'foreign'.
  228. invalid_models.clashm2m: Accessor for m2m field 'm2m' clashes with m2m field 'Target2.clashm2m_set'. Add a related_name argument to the definition for 'm2m'.
  229. invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
  230. invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
  231. invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
  232. invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
  233. invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
  234. invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
  235. invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
  236. invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
  237. invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
  238. invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
  239. invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
  240. invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
  241. invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
  242. invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
  243. invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
  244. invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
  245. invalid_models.selfclashforeign: Accessor for field 'selfclashforeign_set' clashes with field 'SelfClashForeign.selfclashforeign_set'. Add a related_name argument to the definition for 'selfclashforeign_set'.
  246. invalid_models.selfclashforeign: Reverse query name for field 'selfclashforeign_set' clashes with field 'SelfClashForeign.selfclashforeign'. Add a related_name argument to the definition for 'selfclashforeign_set'.
  247. invalid_models.selfclashforeign: Accessor for field 'foreign_1' clashes with field 'SelfClashForeign.id'. Add a related_name argument to the definition for 'foreign_1'.
  248. invalid_models.selfclashforeign: Reverse query name for field 'foreign_1' clashes with field 'SelfClashForeign.id'. Add a related_name argument to the definition for 'foreign_1'.
  249. invalid_models.selfclashforeign: Accessor for field 'foreign_2' clashes with field 'SelfClashForeign.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
  250. invalid_models.selfclashforeign: Reverse query name for field 'foreign_2' clashes with field 'SelfClashForeign.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
  251. invalid_models.selfclashm2m: Accessor for m2m field 'selfclashm2m_set' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'selfclashm2m_set'.
  252. invalid_models.selfclashm2m: Reverse query name for m2m field 'selfclashm2m_set' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'selfclashm2m_set'.
  253. invalid_models.selfclashm2m: Accessor for m2m field 'selfclashm2m_set' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'selfclashm2m_set'.
  254. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_1' clashes with field 'SelfClashM2M.id'. Add a related_name argument to the definition for 'm2m_1'.
  255. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_2' clashes with field 'SelfClashM2M.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
  256. invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_1' clashes with field 'SelfClashM2M.id'. Add a related_name argument to the definition for 'm2m_1'.
  257. invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_2' clashes with field 'SelfClashM2M.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
  258. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
  259. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
  260. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
  261. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
  262. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
  263. invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
  264. invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_3' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'm2m_3'.
  265. invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_4' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'm2m_4'.
  266. invalid_models.missingrelations: 'rel1' has a relation with model Rel1, which has either not been installed or is abstract.
  267. invalid_models.missingrelations: 'rel2' has an m2m relation with model Rel2, which has either not been installed or is abstract.
  268. invalid_models.grouptwo: 'primary' is a manually-defined m2m relation through model Membership, which does not have foreign keys to Person and GroupTwo
  269. invalid_models.grouptwo: 'secondary' is a manually-defined m2m relation through model MembershipMissingFK, which does not have foreign keys to Group and GroupTwo
  270. invalid_models.missingmanualm2mmodel: 'missing_m2m' specifies an m2m relation through model MissingM2MModel, which has not been installed
  271. invalid_models.group: The model Group has two manually-defined m2m relations through the model Membership, which is not permitted. Please consider using an extra field on your intermediary model instead.
  272. invalid_models.group: Intermediary model RelationshipDoubleFK has more than one foreign key to Person, which is ambiguous and is not permitted.
  273. invalid_models.personselfrefm2m: Many-to-many fields with intermediate tables cannot be symmetrical.
  274. invalid_models.personselfrefm2m: Intermediary model RelationshipTripleFK has more than two foreign keys to PersonSelfRefM2M, which is ambiguous and is not permitted.
  275. invalid_models.personselfrefm2mexplicit: Many-to-many fields with intermediate tables cannot be symmetrical.
  276. invalid_models.abstractrelationmodel: 'fk1' has a relation with model AbstractModel, which has either not been installed or is abstract.
  277. invalid_models.abstractrelationmodel: 'fk2' has an m2m relation with model AbstractModel, which has either not been installed or is abstract.
  278. invalid_models.uniquem2m: ManyToManyFields cannot be unique. Remove the unique argument on 'unique_people'.
  279. invalid_models.nonuniquefktarget1: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
  280. invalid_models.nonuniquefktarget2: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
  281. invalid_models.nonexistingorderingwithsingleunderscore: "ordering" refers to "does_not_exist", a field that doesn't exist.
  282. invalid_models.invalidsetnull: 'fk' specifies on_delete=SET_NULL, but cannot be null.
  283. invalid_models.invalidsetdefault: 'fk' specifies on_delete=SET_DEFAULT, but has no default value.
  284. """