mirror of https://github.com/r4sas/py-i2phosts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
14 years ago
|
from django.db import models
|
||
|
|
||
|
class i2phost(models.Model):
|
||
|
# Hostname limit is 67 characters maximum, including the '.i2p'.
|
||
14 years ago
|
name = models.CharField("I2P hostname", max_length=67, unique=True)
|
||
14 years ago
|
# Maximum key length 616 bytes (to account for certs up to 100 bytes).
|
||
14 years ago
|
b64hash = models.CharField("Base 64 hash", max_length=616)
|
||
14 years ago
|
description = models.CharField("Description", max_length=4096, blank=True)
|
||
14 years ago
|
date_added = models.DateTimeField(auto_now_add=True)
|
||
14 years ago
|
# Last time this host was up
|
||
14 years ago
|
last_seen = models.DateTimeField(null=True, blank=True)
|
||
14 years ago
|
# Scheduled expiration date
|
||
14 years ago
|
expires = models.DateField(null=True, blank=True)
|
||
14 years ago
|
# Not-activated hosts will not appear in exported hosts.txt
|
||
14 years ago
|
activated = models.BooleanField(default=False)
|
||
14 years ago
|
# Indicator for hosts added from external source
|
||
14 years ago
|
external = models.BooleanField(default=False)
|
||
14 years ago
|
# Not approved hosts will not appear in exported hosts.txt
|
||
|
approved = models.BooleanField(default=False)
|
||
14 years ago
|
|
||
|
def __unicode__(self):
|
||
|
return self.name
|
||
14 years ago
|
|
||
|
class PendingHost(i2phost):
|
||
|
""" Proxy model needed for displaying not approved hosts in django admin separatelly """
|
||
|
class Meta:
|
||
|
proxy = True
|