This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-11-11 12:41:48 +00:00
|
|
|
"""passbook application administration"""
|
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
from django.views.generic import CreateView, ListView
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2018-11-16 08:10:35 +00:00
|
|
|
from passbook.admin.mixins import AdminRequiredMixin
|
2018-11-11 12:41:48 +00:00
|
|
|
from passbook.core.models import Application
|
|
|
|
|
|
|
|
|
2018-11-16 08:10:35 +00:00
|
|
|
class ApplicationListView(AdminRequiredMixin, ListView):
|
2018-11-16 12:08:37 +00:00
|
|
|
"""List all applications"""
|
|
|
|
|
2018-11-11 12:41:48 +00:00
|
|
|
model = Application
|
2018-11-16 08:10:35 +00:00
|
|
|
template_name = 'administration/application/list.html'
|
2018-11-11 12:41:48 +00:00
|
|
|
|
2018-11-16 08:10:35 +00:00
|
|
|
|
|
|
|
class ApplicationCreateView(AdminRequiredMixin, CreateView):
|
2018-11-16 12:08:37 +00:00
|
|
|
"""Create new application"""
|
2018-11-11 12:41:48 +00:00
|
|
|
|
|
|
|
model = Application
|
|
|
|
template_name = 'administration/application/create.html'
|
|
|
|
fields = ['name', 'launch_url', 'icon_url']
|