1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.11.x] Fixed #28199 -- Fixed Subquery generating unnecessary/invalid CAST.

Thanks Simon Charette for the fix.

Backport of f04495521a from master
This commit is contained in:
Tim Graham
2017-05-30 06:40:41 -04:00
parent 3e17b0222c
commit 9b9a81024a
4 changed files with 18 additions and 3 deletions

View File

@@ -1,9 +1,10 @@
"""
Tests for F() query expression syntax.
"""
from __future__ import unicode_literals
import uuid
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@@ -88,9 +89,14 @@ class SimulationRun(models.Model):
return "%s (%s to %s)" % (self.midpoint, self.start, self.end)
class UUIDPK(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4)
@python_2_unicode_compatible
class UUID(models.Model):
uuid = models.UUIDField(null=True)
uuid_fk = models.ForeignKey(UUIDPK, models.CASCADE, null=True)
def __str__(self):
return "%s" % self.uuid