Add hosting plans and account assignment
Manage hosting plans in the panel and allow authorized operators to assign them to hosting accounts.
This commit is contained in:
1 parent
e59ee72940
commit
bb95b86173
13 files changed
+346
-15
No files matched your search
@@ -4,9 +4,23 @@ from django.urls import reverse
|
||||
from .fields import DomainNameField
|
||||
|
||||
|
||||
class HostingPlan(models.Model):
|
||||
name = models.CharField(max_length=120, unique=True)
|
||||
description = models.CharField(max_length=240, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ("name", "pk")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class HostingAccount(models.Model):
|
||||
name = models.CharField(max_length=120)
|
||||
primary_domain = DomainNameField(max_length=253, unique=True)
|
||||
hosting_plan = models.ForeignKey(
|
||||
HostingPlan, on_delete=models.PROTECT, null=True, blank=True
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def get_absolute_url(self):
|
||||
|
||||
Reference in new issue
Block a user