PageRenderTime 4ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/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
Possible License(s): BSD-3-Clause
  1. from django.db import models
  2. class Publisher(models.Model):
  3. name = models.CharField(max_length=100)
  4. class Author(models.Model):
  5. name = models.CharField(max_length=100)
  6. class Book(models.Model):
  7. name = models.CharField(max_length=100)
  8. authors = models.ManyToManyField(Author, related_name='books')
  9. publisher = models.ForeignKey(Publisher, related_name='books', db_column="publisher_id_column")