2010-10-06 19:02:08 +00:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
class i2phost(models.Model):
|
|
|
|
# Hostname limit is 67 characters maximum, including the '.i2p'.
|
2010-10-06 19:02:08 +00:00
|
|
|
name = models.CharField("I2P hostname", max_length=67, unique=True)
|
2010-10-06 19:02:08 +00:00
|
|
|
# Maximum key length 616 bytes (to account for certs up to 100 bytes).
|
2010-10-13 17:06:35 +00:00
|
|
|
b64hash = models.CharField("Base 64 hash", max_length=616)
|
2010-10-06 19:02:08 +00:00
|
|
|
description = models.TextField("Description", blank=True)
|
2010-10-06 19:02:08 +00:00
|
|
|
date_added = models.DateTimeField(auto_now_add=True)
|
2010-10-14 20:00:49 +00:00
|
|
|
# Last time this host was up
|
2010-10-16 18:22:51 +00:00
|
|
|
last_seen = models.DateTimeField(null=True)
|
2010-10-14 18:25:34 +00:00
|
|
|
# Not-activated hosts will not appear in exported hosts.txt
|
2010-10-06 19:02:08 +00:00
|
|
|
activated = models.BooleanField(default=False)
|
2010-10-14 19:14:31 +00:00
|
|
|
# Indicator for hosts added from external source
|
2010-10-14 18:21:50 +00:00
|
|
|
external = models.BooleanField(default=False)
|
2010-10-13 18:07:52 +00:00
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|