MyHost / src / hosts / models.py

# -*- coding: utf-8 -*-

"""models of myhost app, holds the Django models
"""
from django.db import models
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User

# Create your models here.

class MyHostUser(models.Model):
    """Details of the user
    """
    user = models.ForeignKey(
        User,
    )

    ldap = models.CharField(
        verbose_name=_(u"LDAP user name"),
        max_length=25,
    )

    date_created = models.DateTimeField(
        verbose_name=_(u"User created"),
        editable=False,
    )

    date_last_update = models.DateTimeField(
        verbose_name=_(u"last update"),
        editable=False,
        )

class Host(models.Model):
    """The host.
    """
    name = models.CharField(
        verbose_name=_(u"Hostname"),
        max_length=100,
    )

    hardware_db_id = models.IntegerField(
        verbose_name=_(u"ID Hardware DB"),
    )

    owner = models.ForeignKey(
        MyHostUser,
        verbose_name=_(u"Owner (responsible person)"),
    )

    user = models.ForeignKey(
        MyHostUser,
        verbose_name=_(u"Current User"),
    )

    location = models.CharField()

    kvm = models.CharField()

    couch_id = models.CharField(
        verbose_name=_(u"Couch DB ID"),
        max_length=50,
    )

    date_added = models.DateTimeField(
        verbose_name=_(u"Date added"),
    )
    date_change = models.DateTimeField(
        verbose_name=_(u"Date last changed"),
    )


class NetworkCard(models.Model):
    """The host.
    """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=100,
        )


class RAM(models.Model):
    """The host.
    """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=100,
        )

    vendor = models.ForeignKey(
        Vendor,
        verbose_name=_(u"Vendor"),
        null=True,
        )


class GraphicBoard(models.Model):
    """The host.
    """

    TYPES = (
        ('O', 'on-board'),
        ('A', 'APU'),
        ('E', 'external'),
    )

    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=100,
        )

    vendor = models.ForeignKey(
        Vendor,
        verbose_name=_(u"Vendor"),
        null=True,
        )

    type = models.CharField(
        max_length=1,
        choices=TYPES,
    )


class CPU(models.Model):
    """CPU model and properties"""
    pass


class Vendor(models.Model):
    """Vendor details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=100,
    )


class Vendor(models.Model):
    """Vendor details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=100,
    )


class BIOS(models.Model):
    """Vendor details """
    vendor = models.CharField(
        verbose_name=_(u"Vendor"),
        max_length=100,
    )

    version = models.CharField(
        verbose_name=_(u"Version"),
    )


class BIOS(models.Model):
    """Vendor details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=50,
    )


class SocketType(models.Model):
    """Socket details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=50,
        )


class NorthBridge(models.Model):
    """Northbridge details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=50,
        )


class SouthBridge(models.Model):
    """Southbridge details """
    name = models.CharField(
        verbose_name=_(u"Name"),
        max_length=50,
        )


"""
System: aftab (610)
Purpose: Develop
Keyword:
Comment:

Current owner: bpetkov
Location: 103
IP KVM: scandium

 	Vendor 	Model 	Socket 	Northbridge 	Southbridge 	Nr. of CPU sockets 	Nr. of RAM sockets 	BIOS 	TPM 	HDT 	Features


CPUs 	Vendor 	Family 	Model 	Stepping 	Revision 	Socket 	Nr. of cores 	Clock 	l2 Cache 	l3 Cache

Networkcards 	Vendor 	Chipset 	Mac 	Bus type 	Media

Harddisks 	Vendor 	Model 	Bus type 	Size in GByte 


RAM 	Vendor 	Type 	Speed 	Size 	ECC

Graphicscards 	Vendor 	Chip 	Memory 	Bus type

Misc 	Vendor 	Type 	Information

Couchid
"""
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.