2008-08-16 20:59:06 +00:00
|
|
|
from django.db import models
|
|
|
|
|
2010-10-12 01:54:19 +00:00
|
|
|
|
2008-08-16 20:59:06 +00:00
|
|
|
class Publisher(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2008-08-16 20:59:06 +00:00
|
|
|
class Author(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2008-08-16 20:59:06 +00:00
|
|
|
class Book(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
authors = models.ManyToManyField(Author, related_name='books')
|
2011-01-10 13:44:35 +00:00
|
|
|
publisher = models.ForeignKey(Publisher, related_name='books', db_column="publisher_id_column")
|