diff options
| author | Tim Graham <timograham@gmail.com> | 2015-02-20 14:28:34 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-23 09:01:00 -0500 |
| commit | 41d5ed480cd55a71b739e779ca11f24caaa2b302 (patch) | |
| tree | 67d5d3df875fddefd3c73e68909426398b81a58c /tests/model_formsets/models.py | |
| parent | 04c262aea9b398c79e753ae75aa12b1520e99854 (diff) | |
[1.8.x] Fixed #24377 -- Fixed model inline formsets with primary key's that have defaults.
Backport of 1306cd1e8acfb13602ee8dc40993b2505cd7523b from master
Diffstat (limited to 'tests/model_formsets/models.py')
| -rw-r--r-- | tests/model_formsets/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/model_formsets/models.py b/tests/model_formsets/models.py index da79c6a573..0b4963208f 100644 --- a/tests/model_formsets/models.py +++ b/tests/model_formsets/models.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import datetime +import uuid from django.db import models from django.utils import six @@ -241,3 +242,15 @@ class Post(models.Model): def __str__(self): return self.name + + +# Models for testing UUID primary keys +class UUIDPKParent(models.Model): + uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + name = models.CharField(max_length=255) + + +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) |
