mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #19463 -- Added UUIDField
Uses native support in postgres, and char(32) on other backends.
This commit is contained in:
parent
0d1561d197
commit
ed7821231b
17 changed files with 274 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue