Django model with uuid5 primary key
Django model with uuid5 primary key Question: I have a problem to define Django model where the Primary Key is UUID5 that base on model fields. Here is what I have got already. class Place(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid5(‘PLACE_UUID_NAMESPACE’, ‘{}{}{}’.format(self.city, self.zip, self.country))) city = models.CharField(max_length=24, blank=True, null=True) zip = models.CharField(max_length=6, blank=True, null=True) country = CountryField(default=’US’) …