summaryrefslogtreecommitdiff
path: root/tests/admin_views/models.py
diff options
context:
space:
mode:
authorAlexander Gaevsky <sasha@sasha0.ru>2016-01-07 11:07:15 +0200
committerTim Graham <timograham@gmail.com>2016-01-08 12:28:32 -0500
commitade54ffa34ddc6c19b26c6ea72b46f73af7b682b (patch)
treebeba0456c0075bf7ad4e0d9f2a30a813b6014272 /tests/admin_views/models.py
parent822a03b3e41c7c26b7b623c782fbcf9e6eea863f (diff)
Refs #25165 -- Fixed JSON serialization for add/edit popup in the admin.
Forwardport of test in o839d71d8562abe0b245024e55ca1d02a45e58fd from stable/1.9.x (refs #25997).
Diffstat (limited to 'tests/admin_views/models.py')
-rw-r--r--tests/admin_views/models.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/admin_views/models.py b/tests/admin_views/models.py
index aa4476c9ed..5411885ee9 100644
--- a/tests/admin_views/models.py
+++ b/tests/admin_views/models.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import datetime
import os
import tempfile
+import uuid
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
@@ -956,3 +957,15 @@ class ReferencedByGenRel(models.Model):
class GenRelReference(models.Model):
references = GenericRelation(ReferencedByGenRel)
+
+
+class ParentWithUUIDPK(models.Model):
+ id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+ title = models.CharField(max_length=100)
+
+ def __str__(self):
+ return str(self.id)
+
+
+class RelatedWithUUIDPKModel(models.Model):
+ parent = models.ForeignKey(ParentWithUUIDPK, on_delete=models.CASCADE)