Ticket #12615: models.py

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