Skip to content

Commit 2a34819

Browse files
committed
Use Django's UUIDField instead of uuidfield package
1 parent fe0a4af commit 2a34819

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

junction/devices/migrations/0001_initial.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
import uuidfield.fields
4+
# import uuidfield.fields
55
from django.db import migrations, models
66

77
import junction.devices.models
@@ -34,12 +34,12 @@ class Migration(migrations.Migration):
3434
auto_now=True, verbose_name="Last Modified At"
3535
),
3636
),
37-
(
38-
"uuid",
39-
uuidfield.fields.UUIDField(
40-
unique=True, max_length=32, db_index=True
41-
),
42-
),
37+
# (
38+
# "uuid",
39+
# uuidfield.fields.UUIDField(
40+
# unique=True, max_length=32, db_index=True
41+
# ),
42+
# ),
4343
("is_verified", models.BooleanField(default=False)),
4444
("verification_code", models.IntegerField()),
4545
(

junction/devices/models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
2+
import uuid
33
import datetime
44

55
from django.db import models
66
from django.utils.timezone import now
7-
from uuidfield import UUIDField
87

98
from junction.base.models import TimeAuditModel
109

@@ -14,7 +13,7 @@ def expiry_time(expiry_mins=60):
1413

1514

1615
class Device(TimeAuditModel):
17-
uuid = UUIDField(version=1, hyphenate=True, unique=True, db_index=True)
16+
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
1817

1918
# Verification
2019
is_verified = models.BooleanField(default=False)

0 commit comments

Comments
 (0)