Ticket #12615: models.py
File models.py, 321 bytes (added by , 15 years ago) |
---|
Line | |
---|---|
1 | from django.db import models |
2 | |
3 | class Person(models.Model): |
4 | name = models.CharField(max_length = 50) |
5 | |
6 | class Zipcode(models.Model): |
7 | people = models.ManyToManyField(Person, through = 'ZipcodePerson') |
8 | |
9 | class ZipcodePerson(models.Model): |
10 | zipcode = models.ForeignKey(Zipcode) |
11 | person = models.ForeignKey(Person) |
12 |