diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2026-06-05 12:10:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-05 12:10:10 +0200 |
| commit | a2348c85fc6c20087935c74cd99340dd4ef2dcdc (patch) | |
| tree | cac239b31e1866a2d0c4df5285857ada28a1f4e5 /tests/inline_formsets/models.py | |
| parent | 8c2d3dca633629effad17ccc98730234f740d03f (diff) | |
Fixed #37139 -- Fixed inlines crash on parent models with db_default on primary key.
Diffstat (limited to 'tests/inline_formsets/models.py')
| -rw-r--r-- | tests/inline_formsets/models.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/inline_formsets/models.py b/tests/inline_formsets/models.py index a090387c42..ccada27e4c 100644 --- a/tests/inline_formsets/models.py +++ b/tests/inline_formsets/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.db.models.functions import UUID4 class School(models.Model): @@ -21,6 +22,27 @@ class Child(models.Model): ] +class ParentUUIDPk(models.Model): + uuid = models.UUIDField(primary_key=True, db_default=UUID4(), editable=False) + + class Meta: + required_db_features = { + "supports_uuid4_function", + "supports_expression_defaults", + } + + +class ChildUUIDPk(models.Model): + parent = models.ForeignKey(ParentUUIDPk, models.CASCADE) + name = models.CharField(max_length=100) + + class Meta: + required_db_features = { + "supports_uuid4_function", + "supports_expression_defaults", + } + + class Poet(models.Model): name = models.CharField(max_length=100) |
