Add Project Files
This commit is contained in:
21
hosts/models.py
Normal file
21
hosts/models.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class Host(models.Model):
|
||||
"""
|
||||
Host model
|
||||
"""
|
||||
host_name = models.URLField("Host", max_length=100)
|
||||
port = models.PositiveSmallIntegerField("Port", default=80)
|
||||
status = models.BooleanField("Status", default=True)
|
||||
status_code = models.PositiveSmallIntegerField("Status Code", default=200)
|
||||
created = models.DateTimeField("Created", auto_now_add=True)
|
||||
updated = models.DateTimeField("Updated", auto_now=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Host"
|
||||
verbose_name_plural = "Hosts"
|
||||
ordering = ["-created"]
|
||||
|
||||
def __str__(self):
|
||||
return self.host_name
|
||||
Reference in New Issue
Block a user