1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Consolidated some many_to_one tests.

This commit is contained in:
Loic Bistuer
2014-09-23 23:29:17 +07:00
parent 2a1bdf5ced
commit 1fd6e13bf2
10 changed files with 244 additions and 276 deletions

View File

@@ -27,3 +27,11 @@ class Article(models.Model):
def __str__(self):
return self.headline
class Car(models.Model):
make = models.CharField(max_length=100, null=True, unique=True)
class Driver(models.Model):
car = models.ForeignKey(Car, to_field='make', null=True, related_name='drivers')