PageRenderTime 17ms CodeModel.GetById 8ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/regressiontests/get_or_create_regress/models.py

https://code.google.com/p/mango-py/
Python | 13 lines | 9 code | 4 blank | 0 comment | 0 complexity | 2841d3baf3f4622d65f10d5b73456bf2 MD5 | raw file
 1from django.db import models
 2
 3
 4class Publisher(models.Model):
 5    name = models.CharField(max_length=100)
 6
 7class Author(models.Model):
 8    name = models.CharField(max_length=100)
 9
10class Book(models.Model):
11    name = models.CharField(max_length=100)
12    authors = models.ManyToManyField(Author, related_name='books')
13    publisher = models.ForeignKey(Publisher, related_name='books', db_column="publisher_id_column")