Created
March 12, 2010 05:11
-
-
Save rdegges/330059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Server(models.Model): | |
""" | |
This class represents a physical server. | |
""" | |
hostname = models.CharField('Server Name', | |
help_text = 'Hostname of the server.', | |
max_length = 50 | |
) | |
ip = models.IPAddressField('Server IP Address', | |
help_text = 'Public IP of the server.', | |
unique = True | |
) | |
disk_space = models.IntegerField('Disk Space on Server', | |
help_text = 'Total disk space in MB.' | |
) | |
ram = models.IntegerField('RAM on Server', | |
help_text = 'Total RAM in MB.' | |
) | |
cpu = models.IntegerField('Processing Power', | |
help_text = 'Total Processing Power in MHz.' | |
) | |
def __unicode__(self): | |
""" | |
Make the model human readable. | |
""" | |
return self.hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment