From b287af5dc954628d4b336aefc5027b2edceee64b Mon Sep 17 00:00:00 2001 From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Date: Wed, 6 Dec 2023 23:19:09 +0100 Subject: Fixed #35019 -- Fixed save() on models with both GeneratedFields and ForeignKeys. Thanks Deb Kumar Das for the report. Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95. --- tests/model_fields/models.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/model_fields/models.py') diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index aea02964e2..69b4e26145 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -502,6 +502,7 @@ class GeneratedModel(models.Model): output_field=models.IntegerField(), db_persist=True, ) + fk = models.ForeignKey(Foo, on_delete=models.CASCADE, null=True) class Meta: required_db_features = {"supports_stored_generated_columns"} @@ -515,6 +516,7 @@ class GeneratedModelVirtual(models.Model): output_field=models.IntegerField(), db_persist=False, ) + fk = models.ForeignKey(Foo, on_delete=models.CASCADE, null=True) class Meta: required_db_features = {"supports_virtual_generated_columns"} -- cgit v1.3