1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[4.2.x] Fixed #34803 -- Fixed queryset crash when filtering againts deeply nested OuterRef annotations.

Thanks Pierre-Nicolas Rigal for the report.

Regression in c67ea79aa9.

Backport of 9cc0d7f7f8 from main
This commit is contained in:
willzhao
2023-08-31 07:51:44 +00:00
committed by Mariusz Felisiak
parent 55a0b9c32e
commit acfb427522
5 changed files with 39 additions and 0 deletions

View File

@@ -8,6 +8,9 @@ from django.db import models
class Manager(models.Model):
name = models.CharField(max_length=50)
secretary = models.ForeignKey(
"Employee", models.CASCADE, null=True, related_name="managers"
)
class Employee(models.Model):
@@ -15,6 +18,7 @@ class Employee(models.Model):
lastname = models.CharField(max_length=50)
salary = models.IntegerField(blank=True, null=True)
manager = models.ForeignKey(Manager, models.CASCADE, null=True)
based_in_eu = models.BooleanField(default=False)
def __str__(self):
return "%s %s" % (self.firstname, self.lastname)