diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2023-12-06 23:19:09 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-12-08 12:09:56 +0100 |
| commit | 03af8fbd0f1cfc08edadda248cf5d3498e8ed2f7 (patch) | |
| tree | 32f8d2d31e59b28cb371d6973cccefb3423d8192 /tests/model_fields/models.py | |
| parent | 6c992dc0031f9f3134aa50d1bc00b1eee581ae13 (diff) | |
[5.0.x] Fixed #35019 -- Fixed save() on models with both GeneratedFields and ForeignKeys.
Thanks Deb Kumar Das for the report.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
Backport of b287af5dc954628d4b336aefc5027b2edceee64b from main
Diffstat (limited to 'tests/model_fields/models.py')
| -rw-r--r-- | tests/model_fields/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
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"} |
