Create database list view.

This commit is contained in:
Santiago Lamora 2019-11-13 12:27:25 +01:00
parent c8e8f778d7
commit 37854207dc
3 changed files with 8 additions and 2 deletions

View File

@ -13,6 +13,7 @@ API_PATHS = {
'my-account': 'accounts/', 'my-account': 'accounts/',
# services # services
'database-list': 'databases/',
'domain-list': 'domains/', 'domain-list': 'domains/',
'address-list': 'addresses/', 'address-list': 'addresses/',
'mailbox-list': 'mailboxes/', 'mailbox-list': 'mailboxes/',

View File

@ -17,6 +17,11 @@ class Service:
return getattr(self, key, self.data.get(key)) return getattr(self, key, self.data.get(key))
class DatabaseService(Service):
api_name = 'database'
fields = ('name', 'type', 'users')
class MailService(Service): class MailService(Service):
api_name = 'address' api_name = 'address'
verbose_name = 'Mail' verbose_name = 'Mail'

View File

@ -88,8 +88,8 @@ class MailingListsView(ServiceListView):
service_class = MailinglistService service_class = MailinglistService
class DatabasesView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): class DatabasesView(ServiceListView):
template_name = "musician/databases.html" service_class = DatabaseService
class SaasView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): class SaasView(CustomContextMixin, UserTokenRequiredMixin, TemplateView):