# Path: cmdb/models.py
# class ConfigurationItem(models.Model):
#     Hostname = models.CharField(max_length=255)
#     Rack = models.ForeignKey('DataCentreRack')
#     Asset = models.CharField(max_length=128)
#     SupportTag = models.CharField(max_length=128)
#     Class = models.ForeignKey(ConfigurationItemClass)
#     Owner = models.ForeignKey(User)
#     NetworkInterface = models.ManyToManyField(NetworkInterface)
#     Profile = models.ForeignKey(ConfigurationItemProfile)
#     VMImagePath = models.CharField(max_length=255,blank=True,null=True,verbose_name='Path for Virtual Images')
#     IsVirtual = models.BooleanField()
#     BuildOnNextBoot = models.BooleanField(verbose_name="PXE Build",help_text="Should this box be rebuilt the next time it is booted?")
#     IsVMHost = models.BooleanField()
#     rootpwhash = models.CharField(max_length=255)
# 
#     def __unicode__(self):
#         return self.Hostname
#     
#     class Meta:
#         #permissions = ()
#         verbose_name = 'Configuration Item'
#         verbose_name_plural = 'Configuration Items'
#         ordering = ['Hostname']


import datetime
from django.db import models
from django.contrib.auth.models import User
from cmdb.models import ConfigurationItem

class Scmtype(models.Model):
	Name = models.CharField(max_length=50)
	LibraryName = models.CharField(max_length=255)

	def __unicode__(self):
		return self.Name

	class Meta:
		verbose_name = 'Source Code Management Tool'
		ordering = ['Name']

class ScmRepo(models.Model):
	Scm = models.ForeignKey(Scmtype)
	Url = models.CharField(max_length=255)
	Name = models.CharField(max_length=255)
	Description = models.CharField(max_length=255)

	def __unicode__(self):
		return self.Name

	class Meta:
		verbose_name = 'Source Code Management Repository'
		verbose_name_plural = 'Source Code Management Repositories'
		ordering = ['Name']

class ChangeHeader(models.Model):
	Title = models.CharField(max_length=255)
	Requestor = models.ForeignKey(User)
	Summary = models.TextField()

# Path: cmdb/models.py
# class ConfigurationItem(models.Model):
#     Hostname = models.CharField(max_length=255)
#     Rack = models.ForeignKey('DataCentreRack')
#     Asset = models.CharField(max_length=128)
#     SupportTag = models.CharField(max_length=128)
#     Class = models.ForeignKey(ConfigurationItemClass)
#     Owner = models.ForeignKey(User)
#     NetworkInterface = models.ManyToManyField(NetworkInterface)
#     Profile = models.ForeignKey(ConfigurationItemProfile)
#     VMImagePath = models.CharField(max_length=255,blank=True,null=True,verbose_name='Path for Virtual Images')
#     IsVirtual = models.BooleanField()
#     BuildOnNextBoot = models.BooleanField(verbose_name="PXE Build",help_text="Should this box be rebuilt the next time it is booted?")
#     IsVMHost = models.BooleanField()
#     rootpwhash = models.CharField(max_length=255)
# 
#     def __unicode__(self):
#         return self.Hostname
#     
#     class Meta:
#         #permissions = ()
#         verbose_name = 'Configuration Item'
#         verbose_name_plural = 'Configuration Items'
#         ordering = ['Hostname']


# Path: changemanagement/models.py
import datetime
from django.db import models
from django.contrib.auth.models import User
from cmdb.models import ConfigurationItem


class Scmtype(models.Model):
	Name = models.CharField(max_length=50)
	LibraryName = models.CharField(max_length=255)

	def __unicode__(self):
		return self.Name

	class Meta:
		verbose_name = 'Source Code Management Tool'
		ordering = ['Name']

class ScmRepo(models.Model):
	Scm = models.ForeignKey(Scmtype)
	Url = models.CharField(max_length=255)
	Name = models.CharField(max_length=255)
	Description = models.CharField(max_length=255)

	def __unicode__(self):
		return self.Name

	class Meta:
		verbose_name = 'Source Code Management Repository'
		verbose_name_plural = 'Source Code Management Repositories'
		ordering = ['Name']

class ChangeHeader(models.Model):
	Title = models.CharField(max_length=255)
	Requestor = models.ForeignKey(User)
	Summary = models.TextField()

	AffectedItems = models.ManyToManyField(ConfigurationItem)