Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django custom primary key field

import uuid
from django.db import models

class MyUUIDModel(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    # other fields
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #custom #primary #key #field
ADD COMMENT
Topic
Name
1+8 =