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