2
from django.db import models
3
from django.utils.encoding import python_2_unicode_compatible
6
class School(models.Model):
7
name = models.CharField(max_length=100)
9
class Parent(models.Model):
10
name = models.CharField(max_length=100)
12
class Child(models.Model):
13
mother = models.ForeignKey(Parent, related_name='mothers_children')
14
father = models.ForeignKey(Parent, related_name='fathers_children')
15
school = models.ForeignKey(School)
16
name = models.CharField(max_length=100)
18
@python_2_unicode_compatible
19
class Poet(models.Model):
20
name = models.CharField(max_length=100)
25
@python_2_unicode_compatible
26
class Poem(models.Model):
27
poet = models.ForeignKey(Poet)
28
name = models.CharField(max_length=100)