<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from django . db import connection , models <EOL> class FieldErrors ( models . Model ) : <EOL> charfield = models . CharField ( ) <EOL> charfield2 = models . CharField ( max_length = - <NUM_LIT:1> ) <EOL> charfield3 = models . CharField ( max_length = "<STR_LIT>" ) <EOL> decimalfield = models . DecimalField ( ) <EOL> decimalfield2 = models . DecimalField ( max_digits = - <NUM_LIT:1> , decimal_places = - <NUM_LIT:1> ) <EOL> decimalfield3 = models . DecimalField ( max_digits = "<STR_LIT>" , decimal_places = "<STR_LIT>" ) <EOL> decimalfield4 = models . DecimalField ( max_digits = <NUM_LIT:9> , decimal_places = <NUM_LIT:10> ) <EOL> decimalfield5 = models . DecimalField ( max_digits = <NUM_LIT:10> , decimal_places = <NUM_LIT:10> ) <EOL> filefield = models . FileField ( ) <EOL> choices = models . CharField ( max_length = <NUM_LIT:10> , choices = '<STR_LIT>' ) <EOL> choices2 = models . CharField ( max_length = <NUM_LIT:10> , choices = [ ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) , ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ] ) <EOL> index = models . CharField ( max_length = <NUM_LIT:10> , db_index = '<STR_LIT>' ) <EOL> field_ = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> nullbool = models . BooleanField ( null = True ) <EOL> generic_ip_notnull_blank = models . GenericIPAddressField ( null = False , blank = True ) <EOL> class Target ( models . Model ) : <EOL> tgt_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> clash1 = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> clash2 = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> clash1_set = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> class Clash1 ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> foreign = models . ForeignKey ( Target ) <EOL> m2m = models . ManyToManyField ( Target ) <EOL> class Clash2 ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> foreign_1 = models . ForeignKey ( Target , related_name = '<STR_LIT:id>' ) <EOL> foreign_2 = models . ForeignKey ( Target , related_name = '<STR_LIT>' ) <EOL> m2m_1 = models . ManyToManyField ( Target , related_name = '<STR_LIT:id>' ) <EOL> m2m_2 = models . ManyToManyField ( Target , related_name = '<STR_LIT>' ) <EOL> class Target2 ( models . Model ) : <EOL> clash3 = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> foreign_tgt = models . ForeignKey ( Target ) <EOL> clashforeign_set = models . ForeignKey ( Target ) <EOL> m2m_tgt = models . ManyToManyField ( Target ) <EOL> clashm2m_set = models . ManyToManyField ( Target ) <EOL> class Clash3 ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> foreign_1 = models . ForeignKey ( Target2 , related_name = '<STR_LIT>' ) <EOL> foreign_2 = models . ForeignKey ( Target2 , related_name = '<STR_LIT>' ) <EOL> m2m_1 = models . ManyToManyField ( Target2 , related_name = '<STR_LIT>' ) <EOL> m2m_2 = models . ManyToManyField ( Target2 , related_name = '<STR_LIT>' ) <EOL> class ClashForeign ( models . Model ) : <EOL> foreign = models . ForeignKey ( Target2 ) <EOL> class ClashM2M ( models . Model ) : <EOL> m2m = models . ManyToManyField ( Target2 ) <EOL> class SelfClashForeign ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> selfclashforeign = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> selfclashforeign_set = models . ForeignKey ( "<STR_LIT>" ) <EOL> foreign_1 = models . ForeignKey ( "<STR_LIT>" , related_name = '<STR_LIT:id>' ) <EOL> foreign_2 = models . ForeignKey ( "<STR_LIT>" , related_name = '<STR_LIT>' ) <EOL> class ValidM2M ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> validm2m = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> validm2m_set = models . ManyToManyField ( "<STR_LIT>" ) <EOL> m2m_1 = models . ManyToManyField ( "<STR_LIT>" , related_name = '<STR_LIT:id>' ) <EOL> m2m_2 = models . ManyToManyField ( "<STR_LIT>" , related_name = '<STR_LIT>' ) <EOL> m2m_3 = models . ManyToManyField ( '<STR_LIT>' ) <EOL> m2m_4 = models . ManyToManyField ( '<STR_LIT>' ) <EOL> class SelfClashM2M ( models . Model ) : <EOL> src_safe = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> selfclashm2m = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> selfclashm2m_set = models . ManyToManyField ( "<STR_LIT>" , symmetrical = False ) <EOL> m2m_1 = models . ManyToManyField ( "<STR_LIT>" , related_name = '<STR_LIT:id>' , symmetrical = False ) <EOL> m2m_2 = models . ManyToManyField ( "<STR_LIT>" , related_name = '<STR_LIT>' , symmetrical = False ) <EOL> m2m_3 = models . ManyToManyField ( '<STR_LIT>' , symmetrical = False ) <EOL> m2m_4 = models . ManyToManyField ( '<STR_LIT>' , symmetrical = False ) <EOL> class Model ( models . Model ) : <EOL> "<STR_LIT>" <EOL> year = models . PositiveIntegerField ( ) <EOL> make = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> name = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> class Car ( models . Model ) : <EOL> colour = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> model = models . ForeignKey ( Model ) <EOL> class MissingRelations ( models . Model ) : <EOL> rel1 = models . ForeignKey ( "<STR_LIT>" ) <EOL> rel2 = models . ManyToManyField ( "<STR_LIT>" ) <EOL> class MissingManualM2MModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> missing_m2m = models . ManyToManyField ( Model , through = "<STR_LIT>" ) <EOL> class Person ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> class Group ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> primary = models . ManyToManyField ( Person , through = "<STR_LIT>" , related_name = "<STR_LIT>" ) <EOL> secondary = models . ManyToManyField ( Person , through = "<STR_LIT>" , related_name = "<STR_LIT>" ) <EOL> tertiary = models . ManyToManyField ( Person , through = "<STR_LIT>" , related_name = "<STR_LIT>" ) <EOL> class GroupTwo ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> primary = models . ManyToManyField ( Person , through = "<STR_LIT>" ) <EOL> secondary = models . ManyToManyField ( Group , through = "<STR_LIT>" ) <EOL> class Membership ( models . Model ) : <EOL> person = models . ForeignKey ( Person ) <EOL> group = models . ForeignKey ( Group ) <EOL> not_default_or_null = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> class MembershipMissingFK ( models . Model ) : <EOL> person = models . ForeignKey ( Person ) <EOL> class PersonSelfRefM2M ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> friends = models . ManyToManyField ( '<STR_LIT>' , through = "<STR_LIT>" ) <EOL> too_many_friends = models . ManyToManyField ( '<STR_LIT>' , through = "<STR_LIT>" ) <EOL> class PersonSelfRefM2MExplicit ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> friends = models . ManyToManyField ( '<STR_LIT>' , through = "<STR_LIT>" , symmetrical = True ) <EOL> class Relationship ( models . Model ) : <EOL> first = models . ForeignKey ( PersonSelfRefM2M , related_name = "<STR_LIT>" ) <EOL> second = models . ForeignKey ( PersonSelfRefM2M , related_name = "<STR_LIT>" ) <EOL> date_added = models . DateTimeField ( ) <EOL> class ExplicitRelationship ( models . Model ) : <EOL> first = models . ForeignKey ( PersonSelfRefM2MExplicit , related_name = "<STR_LIT>" ) <EOL> second = models . ForeignKey ( PersonSelfRefM2MExplicit , related_name = "<STR_LIT>" ) <EOL> date_added = models . DateTimeField ( ) <EOL> class RelationshipTripleFK ( models . Model ) : <EOL> first = models . ForeignKey ( PersonSelfRefM2M , related_name = "<STR_LIT>" ) <EOL> second = models . ForeignKey ( PersonSelfRefM2M , related_name = "<STR_LIT>" ) <EOL> third = models . ForeignKey ( PersonSelfRefM2M , related_name = "<STR_LIT>" ) <EOL> date_added = models . DateTimeField ( ) <EOL> class RelationshipDoubleFK ( models . Model ) : <EOL> first = models . ForeignKey ( Person , related_name = "<STR_LIT>" ) <EOL> second = models . ForeignKey ( Person , related_name = "<STR_LIT>" ) <EOL> third = models . ForeignKey ( Group , related_name = "<STR_LIT>" ) <EOL> date_added = models . DateTimeField ( ) <EOL> class AbstractModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:10> ) <EOL> class Meta : <EOL> abstract = True <EOL> class AbstractRelationModel ( models . Model ) : <EOL> fk1 = models . ForeignKey ( '<STR_LIT>' ) <EOL> fk2 = models . ManyToManyField ( '<STR_LIT>' ) <EOL> class UniqueM2M ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> unique_people = models . ManyToManyField ( Person , unique = True ) <EOL> class NonUniqueFKTarget1 ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> tgt = models . ForeignKey ( '<STR_LIT>' , to_field = '<STR_LIT>' ) <EOL> class UniqueFKTarget1 ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> tgt = models . ForeignKey ( '<STR_LIT>' , to_field = '<STR_LIT>' ) <EOL> class FKTarget ( models . Model ) : <EOL> bad = models . IntegerField ( ) <EOL> good = models . IntegerField ( unique = True ) <EOL> class NonUniqueFKTarget2 ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> tgt = models . ForeignKey ( FKTarget , to_field = '<STR_LIT>' ) <EOL> class UniqueFKTarget2 ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> tgt = models . ForeignKey ( FKTarget , to_field = '<STR_LIT>' ) <EOL> class NonExistingOrderingWithSingleUnderscore ( models . Model ) : <EOL> class Meta : <EOL> ordering = ( "<STR_LIT>" , ) <EOL> class InvalidSetNull ( models . Model ) : <EOL> fk = models . ForeignKey ( '<STR_LIT>' , on_delete = models . SET_NULL ) <EOL> class InvalidSetDefault ( models . Model ) : <EOL> fk = models . ForeignKey ( '<STR_LIT>' , on_delete = models . SET_DEFAULT ) <EOL> class UnicodeForeignKeys ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> good = models . ForeignKey ( '<STR_LIT>' ) <EOL> also_good = models . ManyToManyField ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> class PrimaryKeyNull ( models . Model ) : <EOL> my_pk_field = models . IntegerField ( primary_key = True , null = True ) <EOL> class OrderByPKModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> , blank = True ) <EOL> class Meta : <EOL> ordering = ( '<STR_LIT>' , ) <EOL> class SwappableModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class Meta : <EOL> swappable = '<STR_LIT>' <EOL> class SwappedModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> foreign = models . ForeignKey ( Target , related_name = '<STR_LIT>' ) <EOL> m2m = models . ManyToManyField ( Target , related_name = '<STR_LIT>' ) <EOL> class Meta : <EOL> swappable = '<STR_LIT>' <EOL> class ReplacementModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> foreign = models . ForeignKey ( Target , related_name = '<STR_LIT>' ) <EOL> m2m = models . ManyToManyField ( Target , related_name = '<STR_LIT>' ) <EOL> class BadSwappableValue ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class Meta : <EOL> swappable = '<STR_LIT>' <EOL> class BadSwappableModel ( models . Model ) : <EOL> """<STR_LIT>""" <EOL> name = models . CharField ( max_length = <NUM_LIT:100> ) <EOL> class Meta : <EOL> swappable = '<STR_LIT>' <EOL> class HardReferenceModel ( models . Model ) : <EOL> fk_1 = models . ForeignKey ( SwappableModel , related_name = '<STR_LIT>' ) <EOL> fk_2 = models . ForeignKey ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> fk_3 = models . ForeignKey ( SwappedModel , related_name = '<STR_LIT>' ) <EOL> fk_4 = models . ForeignKey ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> m2m_1 = models . ManyToManyField ( SwappableModel , related_name = '<STR_LIT>' ) <EOL> m2m_2 = models . ManyToManyField ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> m2m_3 = models . ManyToManyField ( SwappedModel , related_name = '<STR_LIT>' ) <EOL> m2m_4 = models . ManyToManyField ( '<STR_LIT>' , related_name = '<STR_LIT>' ) <EOL> class BadIndexTogether1 ( models . Model ) : <EOL> class Meta : <EOL> index_together = [ <EOL> [ "<STR_LIT>" ] , <EOL> ] <EOL> model_errors = """<STR_LIT>""" <EOL> if not connection . features . interprets_empty_strings_as_nulls : <EOL> model_errors += """<STR_LIT>""" </s>
