Merged custom_columns_regress into the custom_columns test package.

This commit is contained in:
Loic Bistuer 2014-09-23 01:07:30 +07:00
parent 7fe554b2a3
commit d42a45de40
5 changed files with 66 additions and 130 deletions

View file

@ -23,6 +23,7 @@ from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
Author_ID = models.AutoField(primary_key=True, db_column='Author ID')
first_name = models.CharField(max_length=30, db_column='firstname')
last_name = models.CharField(max_length=30, db_column='last')
@ -36,8 +37,10 @@ class Author(models.Model):
@python_2_unicode_compatible
class Article(models.Model):
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
headline = models.CharField(max_length=100)
authors = models.ManyToManyField(Author, db_table='my_m2m_table')
primary_author = models.ForeignKey(Author, db_column='Author ID', related_name='primary_set', null=True)
def __str__(self):
return self.headline