From ed7821231b7dbf34a6c8ca65be3b9bcbda4a0703 Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Tue, 15 Jul 2014 10:35:29 +0100 Subject: Fixed #19463 -- Added UUIDField Uses native support in postgres, and char(32) on other backends. --- tests/model_fields/models.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/model_fields/models.py') diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 430722cf4b..ed1cfa8e8d 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -1,5 +1,6 @@ import os import tempfile +import uuid import warnings try: @@ -294,3 +295,15 @@ if Image: width_field='headshot_width') ############################################################################### + + +class UUIDModel(models.Model): + field = models.UUIDField() + + +class NullableUUIDModel(models.Model): + field = models.UUIDField(blank=True, null=True) + + +class PrimaryKeyUUIDModel(models.Model): + id = models.UUIDField(primary_key=True, default=uuid.uuid4) -- cgit v1.3