summaryrefslogtreecommitdiff
path: root/tests/model_formsets/models.py
diff options
context:
space:
mode:
authorJason Hoos <jhoos@maestrohealth.com>2015-06-05 15:04:24 -0500
committerTim Graham <timograham@gmail.com>2015-06-26 09:15:59 -0400
commit429680146304c44e92ecff655280bc464121f769 (patch)
tree6d341529e1d545f8b5d5c994b72a3fbdc7afa27c /tests/model_formsets/models.py
parenta97e50c5e6afe0ce2a8fb2ca27c88e57611b0053 (diff)
[1.8.x] Fixed #24958 -- Fixed inline forms using UUID-PK parents with auto-PK children.
Backport of a50b66da30320887c23c73927f6b2ab41e0301bf from master
Diffstat (limited to 'tests/model_formsets/models.py')
-rw-r--r--tests/model_formsets/models.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/model_formsets/models.py b/tests/model_formsets/models.py
index 0b4963208f..18b2525738 100644
--- a/tests/model_formsets/models.py
+++ b/tests/model_formsets/models.py
@@ -254,3 +254,33 @@ class UUIDPKChild(models.Model):
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=255)
parent = models.ForeignKey(UUIDPKParent)
+
+
+class ChildWithEditablePK(models.Model):
+ name = models.CharField(max_length=255, primary_key=True)
+ parent = models.ForeignKey(UUIDPKParent)
+
+
+class AutoPKChildOfUUIDPKParent(models.Model):
+ name = models.CharField(max_length=255)
+ parent = models.ForeignKey(UUIDPKParent)
+
+
+class AutoPKParent(models.Model):
+ name = models.CharField(max_length=255)
+
+
+class UUIDPKChildOfAutoPKParent(models.Model):
+ uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+ name = models.CharField(max_length=255)
+ parent = models.ForeignKey(AutoPKParent)
+
+
+class ParentWithUUIDAlternateKey(models.Model):
+ uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=False)
+ name = models.CharField(max_length=50)
+
+
+class ChildRelatedViaAK(models.Model):
+ name = models.CharField(max_length=255)
+ parent = models.ForeignKey(to=ParentWithUUIDAlternateKey, to_field='uuid')