summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJohannes Westphal <jojo@w-hat.de>2024-03-30 22:14:15 +0000
committerJohannes Westphal <jojo@w-hat.de>2024-04-01 18:54:38 +0100
commit5f180216409d75290478c71ddb0ff8a68c91dc16 (patch)
treefa0c74e0aae0d68b78649a829f67a916747e3fc3 /django
parent425b26092f038accd2a5c5fc5a9bd3f82d4dd847 (diff)
Fixed #35344, Refs #34838 -- Corrected output_field of resolved columns for GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/generated.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/generated.py b/django/db/models/fields/generated.py
index 257feeeba2..5b6b188df0 100644
--- a/django/db/models/fields/generated.py
+++ b/django/db/models/fields/generated.py
@@ -39,7 +39,7 @@ class GeneratedField(Field):
return Col(self.model._meta.db_table, self, self.output_field)
def get_col(self, alias, output_field=None):
- if alias != self.model._meta.db_table and output_field is None:
+ if alias != self.model._meta.db_table and output_field in (None, self):
output_field = self.output_field
return super().get_col(alias, output_field)