mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #36282 -- Used prefetched values in ForwardManyToOneDescriptor from indirect ancestors.
When looking for cached values in ManyRelatedManager and ForwardManyToOneDescriptor walk up the whole chain of ancestors (as long as they are cached) to find the prefetched relation.
This commit is contained in:
committed by
Sarah Boyce
parent
5488530a27
commit
e709301000
@@ -28,6 +28,10 @@ class AuthorWithAge(Author):
|
||||
age = models.IntegerField()
|
||||
|
||||
|
||||
class AuthorWithAgeChild(AuthorWithAge):
|
||||
pass
|
||||
|
||||
|
||||
class FavoriteAuthors(models.Model):
|
||||
author = models.ForeignKey(
|
||||
Author, models.CASCADE, to_field="name", related_name="i_like"
|
||||
|
||||
Reference in New Issue
Block a user