zoukankan      html  css  js  c++  java
  • cmdb models数据库结构



    from
    __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models # Create your models here. class Host(models.Model): hostame = models.CharField(max_length=64) ip = models.GenericIPAddressField() port = models.IntegerField() system_type_choices=( ('linux','LINUX'), ('wind64','Windows64'), ) system_type=models.CharField(choices=system_type_choices,max_length=64) enable = models.BooleanField(default=True) online_date = models.DateTimeField(auto_now_add=True) groups = models.ManyToManyField('HostGroup') idc = models.ForeignKey('IDC') def __unicode__(self): return self.hostame class HostGroup(models.Model): name = models.CharField(max_length=64,unique=True) def __unicode__(self): return self.name class IDC(models.Model): name = models.CharField(max_length=64,unique=True) def __unicode__(self): return self.name class UserProfile(models.Model): user = models.OneToOneField(User) name = models.CharField(max_length=64,unique=True) host_groups = models.ManyToManyField("HostGroup",blank=True,null=True) hosts = models.ManyToManyField('Host',blank=True,null=True)
  • 相关阅读:
    使用Stream流递归 组合树形结构
    MySQL 8 通用表表达式
    sa-token 权限认证
    先更新缓存还是先更新数据库?
    钉钉 回调事件 消息加解密
    commons-io
    stream和parallelstream的区别
    消除if...else
    springboot 扩展xml请求和响应
    springboot admin 邮箱
  • 原文地址:https://www.cnblogs.com/fengjian2016/p/5394884.html
Copyright © 2011-2022 走看看