from django.contrib.contenttypes.fields import (
    GenericForeignKey, GenericRelation
)
from django.contrib.contenttypes.models import ContentType
from django.db import models


class Award(models.Model):
    name = models.CharField(max_length=25)
    object_id = models.PositiveIntegerField()
    content_type = models.ForeignKey(ContentType)
    content_object = GenericForeignKey()


class AwardNote(models.Model):
    award = models.ForeignKey(Award)
    note = models.CharField(max_length=100)


class Person(models.Model):
    name = models.CharField(max_length=25)
    awards = GenericRelation(Award)


class Book(models.Model):
    pagecount = models.IntegerField()


class Toy(models.Model):
    name = models.CharField(max_length=50)


class Child(models.Model):
    name = models.CharField(max_length=50)
    toys = models.ManyToManyField(Toy, through='PlayedWith')


class PlayedWith(models.Model):
    child = models.ForeignKey(Child)
    toy = models.ForeignKey(Toy)
    date = models.DateField(db_column='date_col')


class PlayedWithNote(models.Model):
    played = models.ForeignKey(PlayedWith)
    note = models.TextField()


class Contact(models.Model):
    label = models.CharField(max_length=100)


class Email(Contact):
    email_address = models.EmailField(max_length=100)


class Researcher(models.Model):
    contacts = models.ManyToManyField(Contact, related_name="research_contacts")


class Food(models.Model):
    name = models.CharField(max_length=20, unique=True)


class Eaten(models.Model):
    food = models.ForeignKey(Food, to_field="name")
    meal = models.CharField(max_length=20)


# Models for #15776


class Policy(models.Model):
    policy_number = models.CharField(max_length=10)


class Version(models.Model):
    policy = models.ForeignKey(Policy)


class Location(models.Model):
    version = models.ForeignKey(Version, blank=True, null=True)


class Item(models.Model):
    version = models.ForeignKey(Version)
    location = models.ForeignKey(Location, blank=True, null=True)

# Models for #16128


class File(models.Model):
    pass


class Image(File):
    class Meta:
        proxy = True


class Photo(Image):
    class Meta:
        proxy = True


class FooImage(models.Model):
    my_image = models.ForeignKey(Image)


class FooFile(models.Model):
    my_file = models.ForeignKey(File)


class FooPhoto(models.Model):
    my_photo = models.ForeignKey(Photo)


class FooFileProxy(FooFile):
    class Meta:
        proxy = True


class OrgUnit(models.Model):
    name = models.CharField(max_length=64, unique=True)


class Login(models.Model):
    description = models.CharField(max_length=32)
    orgunit = models.ForeignKey(OrgUnit)


class House(models.Model):
    address = models.CharField(max_length=32)


class OrderedPerson(models.Model):
    name = models.CharField(max_length=32)
    lives_in = models.ForeignKey(House)

    class Meta:
        ordering = ['name']

[((218, 249), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(25)'}), '(max_length=25)\n', (234, 249), False, 'from django.db import models\n'), ((266, 295), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {}), '()\n', (293, 295), False, 'from django.db import models\n'), ((315, 345), 'django.db.models.ForeignKey', 'models.ForeignKey', (['ContentType'], {}), '(ContentType)\n', (332, 345), False, 'from django.db import models\n'), ((367, 386), 'django.contrib.contenttypes.fields.GenericForeignKey', 'GenericForeignKey', ([], {}), '()\n', (384, 386), False, 'from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation\n'), ((432, 456), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Award'], {}), '(Award)\n', (449, 456), False, 'from django.db import models\n'), ((468, 500), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (484, 500), False, 'from django.db import models\n'), ((542, 573), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(25)'}), '(max_length=25)\n', (558, 573), False, 'from django.db import models\n'), ((587, 609), 'django.contrib.contenttypes.fields.GenericRelation', 'GenericRelation', (['Award'], {}), '(Award)\n', (602, 609), False, 'from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation\n'), ((654, 675), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (673, 675), False, 'from django.db import models\n'), ((714, 745), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (730, 745), False, 'from django.db import models\n'), ((786, 817), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)'}), '(max_length=50)\n', (802, 817), False, 'from django.db import models\n'), ((829, 878), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['Toy'], {'through': '"""PlayedWith"""'}), "(Toy, through='PlayedWith')\n", (851, 878), False, 'from django.db import models\n'), ((925, 949), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Child'], {}), '(Child)\n', (942, 949), False, 'from django.db import models\n'), ((960, 982), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Toy'], {}), '(Toy)\n', (977, 982), False, 'from django.db import models\n'), ((994, 1032), 'django.db.models.DateField', 'models.DateField', ([], {'db_column': '"""date_col"""'}), "(db_column='date_col')\n", (1010, 1032), False, 'from django.db import models\n'), ((1084, 1113), 'django.db.models.ForeignKey', 'models.ForeignKey', (['PlayedWith'], {}), '(PlayedWith)\n', (1101, 1113), False, 'from django.db import models\n'), ((1125, 1143), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (1141, 1143), False, 'from django.db import models\n'), ((1187, 1219), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (1203, 1219), False, 'from django.db import models\n'), ((1264, 1297), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (1281, 1297), False, 'from django.db import models\n'), ((1347, 1412), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['Contact'], {'related_name': '"""research_contacts"""'}), "(Contact, related_name='research_contacts')\n", (1369, 1412), False, 'from django.db import models\n'), ((1452, 1496), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'unique': '(True)'}), '(max_length=20, unique=True)\n', (1468, 1496), False, 'from django.db import models\n'), ((1537, 1577), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Food'], {'to_field': '"""name"""'}), "(Food, to_field='name')\n", (1554, 1577), False, 'from django.db import models\n'), ((1589, 1620), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20)\n', (1605, 1620), False, 'from django.db import models\n'), ((1693, 1724), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(10)'}), '(max_length=10)\n', (1709, 1724), False, 'from django.db import models\n'), ((1769, 1794), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Policy'], {}), '(Policy)\n', (1786, 1794), False, 'from django.db import models\n'), ((1841, 1890), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Version'], {'blank': '(True)', 'null': '(True)'}), '(Version, blank=True, null=True)\n', (1858, 1890), False, 'from django.db import models\n'), ((1933, 1959), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Version'], {}), '(Version)\n', (1950, 1959), False, 'from django.db import models\n'), ((1975, 2025), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Location'], {'blank': '(True)', 'null': '(True)'}), '(Location, blank=True, null=True)\n', (1992, 2025), False, 'from django.db import models\n'), ((2248, 2272), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Image'], {}), '(Image)\n', (2265, 2272), False, 'from django.db import models\n'), ((2318, 2341), 'django.db.models.ForeignKey', 'models.ForeignKey', (['File'], {}), '(File)\n', (2335, 2341), False, 'from django.db import models\n'), ((2389, 2413), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Photo'], {}), '(Photo)\n', (2406, 2413), False, 'from django.db import models\n'), ((2524, 2568), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)', 'unique': '(True)'}), '(max_length=64, unique=True)\n', (2540, 2568), False, 'from django.db import models\n'), ((2616, 2647), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)'}), '(max_length=32)\n', (2632, 2647), False, 'from django.db import models\n'), ((2662, 2688), 'django.db.models.ForeignKey', 'models.ForeignKey', (['OrgUnit'], {}), '(OrgUnit)\n', (2679, 2688), False, 'from django.db import models\n'), ((2732, 2763), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)'}), '(max_length=32)\n', (2748, 2763), False, 'from django.db import models\n'), ((2812, 2843), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(32)'}), '(max_length=32)\n', (2828, 2843), False, 'from django.db import models\n'), ((2859, 2883), 'django.db.models.ForeignKey', 'models.ForeignKey', (['House'], {}), '(House)\n', (2876, 2883), False, 'from django.db import models\n')]