author | Nishanth Amuluru <nishanth@fossee.in> |
Tue, 11 Jan 2011 12:30:10 +0530 | |
changeset 378 | 8fcde6f8f750 |
parent 307 | c6bca38c1cbf |
permissions | -rw-r--r-- |
from django.db import models class User(models.Model): username = models.CharField(max_length=12, unique=True) serial = models.IntegerField() class UserSite(models.Model): user = models.ForeignKey(User, to_field="username") data = models.IntegerField() class Place(models.Model): name = models.CharField(max_length=50) class Restaurant(Place): pass class Manager(models.Model): retaurant = models.ForeignKey(Restaurant) name = models.CharField(max_length=50)