PageRenderTime 81ms CodeModel.GetById 40ms app.highlight 7ms RepoModel.GetById 33ms app.codeStats 0ms

/tests/regressiontests/delete_regress/models.py

https://code.google.com/p/mango-py/
Python | 69 lines | 48 code | 20 blank | 1 comment | 0 complexity | 8ae4d088ebf8698088f86fc5c4b33228 MD5 | raw file
 1from django.db import models
 2
 3from django.contrib.contenttypes import generic
 4from django.contrib.contenttypes.models import ContentType
 5
 6class Award(models.Model):
 7    name = models.CharField(max_length=25)
 8    object_id = models.PositiveIntegerField()
 9    content_type = models.ForeignKey(ContentType)
10    content_object = generic.GenericForeignKey()
11
12class AwardNote(models.Model):
13    award = models.ForeignKey(Award)
14    note = models.CharField(max_length=100)
15
16class Person(models.Model):
17    name = models.CharField(max_length=25)
18    awards = generic.GenericRelation(Award)
19
20class Book(models.Model):
21    pagecount = models.IntegerField()
22
23class Toy(models.Model):
24    name = models.CharField(max_length=50)
25
26class Child(models.Model):
27    name = models.CharField(max_length=50)
28    toys = models.ManyToManyField(Toy, through='PlayedWith')
29
30class PlayedWith(models.Model):
31    child = models.ForeignKey(Child)
32    toy = models.ForeignKey(Toy)
33    date = models.DateField(db_column='date_col')
34
35class PlayedWithNote(models.Model):
36    played = models.ForeignKey(PlayedWith)
37    note = models.TextField()
38
39class Contact(models.Model):
40    label = models.CharField(max_length=100)
41
42class Email(Contact):
43    email_address = models.EmailField(max_length=100)
44
45class Researcher(models.Model):
46    contacts = models.ManyToManyField(Contact, related_name="research_contacts")
47
48class Food(models.Model):
49    name = models.CharField(max_length=20, unique=True)
50
51class Eaten(models.Model):
52    food = models.ForeignKey(Food, to_field="name")
53    meal = models.CharField(max_length=20)
54
55
56# Models for #15776
57
58class Policy(models.Model):
59    policy_number = models.CharField(max_length=10)
60
61class Version(models.Model):
62    policy = models.ForeignKey(Policy)
63
64class Location(models.Model):
65    version = models.ForeignKey(Version, blank=True, null=True)
66
67class Item(models.Model):
68    version = models.ForeignKey(Version)
69    location = models.ForeignKey(Location, blank=True, null=True)