修改asset models

pull/6/head
guanghongwei 2015-01-10 13:30:01 +08:00
parent 67074fa895
commit 30cfa8a5f4
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import datetime
from django.db import models
from juser.models import Group, User
from juser.models import Group as UserGroup
class IDC(models.Model):
@ -10,6 +10,7 @@ class IDC(models.Model):
def __unicode__(self):
return self.name
class Group(models.Model):
name = models.CharField(max_length=80, unique=True)
comment = models.CharField(max_length=160, blank=True, null=True)
@ -28,7 +29,8 @@ class Asset(models.Model):
ip = models.IPAddressField(unique=True)
port = models.SmallIntegerField(max_length=5)
idc = models.ForeignKey(IDC)
group = models.ManyToManyField(Group)
user_group = models.ManyToManyField(UserGroup)
bis_group = models.ManyToManyField(Group)
login_type = models.CharField(max_length=1, choices=LOGIN_TYPE_CHOICES, default='L')
username_common = models.CharField(max_length=20, blank=True, null=True)
password_common = models.CharField(max_length=80, blank=True, null=True)