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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user