def uuid_general(): return uuid.uuid1().hex class JsonModels(models.Model): names=models.CharField(max_length=50) attrs =JSONField(null=True) uid=models.UUIDField(default=uuid_general,primary_key=True) class Meta: db_table='tbl_uuid_field' verbose_name="jsonfield测试"
测试生成:
数据库存储: