[Change] 全部使用uuid作为主键

This commit is contained in:
ibuler
2017-11-23 14:08:01 +08:00
parent d80cbe270a
commit e7f38ec894
21 changed files with 102 additions and 89 deletions

View File

@@ -4,6 +4,8 @@
from __future__ import unicode_literals
import uuid
from django.db import models
import logging
from django.utils.translation import ugettext_lazy as _
@@ -15,6 +17,7 @@ logger = logging.getLogger(__name__)
class AssetGroup(models.Model):
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
name = models.CharField(max_length=64, unique=True, verbose_name=_('Name'))
system_users = models.ManyToManyField(SystemUser, related_name='asset_groups', blank=True)
created_by = models.CharField(max_length=32, blank=True, verbose_name=_('Created by'))