I'd like to use two different primary keys in my DRF database app. By default Django "create" id as PK but when I'm trying to define new field in model (uuid = models.UUIDField (primary_key=True, default=uuid.uuid4, editable=False), default id field is not defined (in DB exist only uuid).
How can I initialize both of them?
I can mention that I didn't define id field in my model because it is (or should be - as I suppose) adding by DRF.
class Store(models.Model):
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4,
editable=False)
name = models.CharField(max_length=100, blank=False)
url = models.URLField(max_length=300, blank=False)
country = models.CharField(max_length=100, blank=True)
storeUUID = models.ForeignKey(Store)
even if uuid isnt PK but only unique ? - Poul3R