mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 00:09:14 +00:00
添加model
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
from django.db import models
|
||||
from juser.models import Group, User
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class IDC(models.Model):
|
||||
name = models.CharField(max_length=80, unique=True)
|
||||
comment = models.CharField(max_length=100, blank=True, null=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class Asset(models.Model):
|
||||
ip = models.IPAddressField(unique=True)
|
||||
port = models.SmallIntegerField(max_length=40)
|
||||
idc = models.ForeignKey(IDC)
|
||||
group = models.ManyToManyField(Group)
|
||||
ldap_enable = models.BooleanField(default=True)
|
||||
username_common = models.CharField(max_length=80, blank=True, null=True)
|
||||
password_common = models.CharField(max_length=160, blank=True, null=True)
|
||||
username_super = models.CharField(max_length=80, blank=True, null=True)
|
||||
password_super = models.CharField(max_length=160, blank=True, null=True)
|
||||
date_added = models.CharField()
|
||||
comment = models.CharField(max_length=100, blank=True, null=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.ip
|
Reference in New Issue
Block a user