mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #27594 -- Fixed select_related() with reverse self-referential OneToOneField.
Fixed definition of `klass_info['from_parent']` so that two models aren't considered from a parent class if the model classes are the same.
This commit is contained in:
parent
2e9fa516fd
commit
7da37699e8
3 changed files with 20 additions and 3 deletions
|
@ -102,3 +102,12 @@ class Child3(Child2):
|
|||
|
||||
class Child4(Child1):
|
||||
value4 = models.IntegerField()
|
||||
|
||||
|
||||
class LinkedList(models.Model):
|
||||
name = models.CharField(max_length=50)
|
||||
previous_item = models.OneToOneField(
|
||||
'self', models.CASCADE,
|
||||
related_name='next_item',
|
||||
blank=True, null=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue