首页 > 数据库技术 > 详细

cmdb models数据库结构

时间:2016-04-15 13:49:44      阅读:238      评论:0      收藏:0      [点我收藏+]


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)

 

cmdb models数据库结构

原文:http://www.cnblogs.com/fengjian2016/p/5394884.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!