mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #11319 - Added lookup support for ForeignKey.to_field. Also reverted no-longer-needed model formsets workaround for lack of such support from r10756. Thanks Russell and Alex for review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -44,3 +44,10 @@ class Email(Contact):
|
||||
|
||||
class Researcher(models.Model):
|
||||
contacts = models.ManyToManyField(Contact, related_name="research_contacts")
|
||||
|
||||
class Food(models.Model):
|
||||
name = models.CharField(max_length=20, unique=True)
|
||||
|
||||
class Eaten(models.Model):
|
||||
food = models.ForeignKey(Food, to_field="name")
|
||||
meal = models.CharField(max_length=20)
|
||||
|
||||
Reference in New Issue
Block a user