add admin site support for hosting domains

This commit is contained in:
Jan Dittberner 2015-01-24 19:24:33 +01:00
parent 0c291f0510
commit 75e4892835
2 changed files with 24 additions and 3 deletions

View file

@ -1,5 +1,14 @@
"""
This module registers the model classes defined in :py:mod:`domains.models`
with the django admin site.
"""
from django.contrib import admin
from .models import MailDomain
from .models import (
MailDomain,
HostingDomain,
)
admin.site.register(MailDomain)
admin.site.register(HostingDomain)

View file

@ -8,10 +8,11 @@ from django import forms
from django.contrib import admin
from .models import (
CustomerHostingPackage,
CustomerDiskSpaceOption,
CustomerUserDatabaseOption,
CustomerHostingPackage,
CustomerHostingPackageDomain,
CustomerMailboxOption,
CustomerUserDatabaseOption,
DiskSpaceOption,
HostingPackageTemplate,
MailboxOption,
@ -78,6 +79,16 @@ class CustomerUserDatabaseOptionInline(admin.TabularInline):
extra = 0
class CustomerHostingPackageDomainInline(admin.TabularInline):
"""
This class implements the inline editor for assigning hosting domains to
hosting packages.
"""
model = CustomerHostingPackageDomain
extra = 0
class CustomerHostingPackageAdmin(admin.ModelAdmin):
"""
This class implements the admin interface for
@ -95,6 +106,7 @@ class CustomerHostingPackageAdmin(admin.ModelAdmin):
CustomerDiskSpaceOptionInline,
CustomerMailboxOptionInline,
CustomerUserDatabaseOptionInline,
CustomerHostingPackageDomainInline,
]
list_display = ['name', 'customer', 'osuser']