author | Nishanth Amuluru <nishanth@fossee.in> |
Tue, 11 Jan 2011 14:30:25 +0530 | |
changeset 142 | e848bd3ad41f |
parent 69 | c6bca38c1cbf |
permissions | -rw-r--r-- |
from django.db import models class Publisher(models.Model): name = models.CharField(max_length=100) class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): name = models.CharField(max_length=100) authors = models.ManyToManyField(Author, related_name='books') publisher = models.ForeignKey(Publisher, related_name='books')