parts/django/tests/regressiontests/get_or_create_regress/models.py
author Nishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 20:25:05 +0530
changeset 319 70726699ca80
parent 307 c6bca38c1cbf
permissions -rw-r--r--
now the text area is displayed in a more elegant way

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')