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

Fixed #20836 -- Ensure that the ForeignKey's to_field attribute is properly considered by the admin's interface when creating related objects.

Many thanks to Collin Anderson for the report and patch and to Peter Sheats for the test.
This commit is contained in:
Julien Phalip
2013-09-07 11:52:14 -05:00
parent 4e784f337c
commit 55a11683f7
11 changed files with 89 additions and 14 deletions

View File

@@ -130,3 +130,11 @@ class School(models.Model):
def __str__(self):
return self.name
@python_2_unicode_compatible
class Profile(models.Model):
user = models.ForeignKey('auth.User', 'username')
def __str__(self):
return self.user.username