PageRenderTime 88ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 7ms

/tests/regressiontests/inline_formsets/models.py

https://code.google.com/p/mango-py/
Python | 28 lines | 19 code | 8 blank | 1 comment | 0 complexity | 72a6584408420994438a98625ddd51ea MD5 | raw file
 1# coding: utf-8
 2from django.db import models
 3
 4
 5class School(models.Model):
 6    name = models.CharField(max_length=100)
 7
 8class Parent(models.Model):
 9    name = models.CharField(max_length=100)
10
11class Child(models.Model):
12    mother = models.ForeignKey(Parent, related_name='mothers_children')
13    father = models.ForeignKey(Parent, related_name='fathers_children')
14    school = models.ForeignKey(School)
15    name = models.CharField(max_length=100)
16
17class Poet(models.Model):
18    name = models.CharField(max_length=100)
19
20    def __unicode__(self):
21        return self.name
22
23class Poem(models.Model):
24    poet = models.ForeignKey(Poet)
25    name = models.CharField(max_length=100)
26
27    def __unicode__(self):
28        return self.name