jumpserver/apps/ops/views.py

25 lines
666 B
Python
Raw Normal View History

2016-11-16 06:20:44 +00:00
# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
2016-08-08 16:43:11 +00:00
2016-11-16 06:20:44 +00:00
from django.conf import settings
2017-03-09 06:55:33 +00:00
from django.views.generic.list import ListView
2016-11-16 06:20:44 +00:00
from users.utils import AdminUserRequiredMixin
2017-03-09 06:55:33 +00:00
from .models import TaskRecord
2016-11-16 06:20:44 +00:00
class TaskListView(AdminUserRequiredMixin, ListView):
paginate_by = settings.CONFIG.DISPLAY_PER_PAGE
2017-03-09 06:55:33 +00:00
model = TaskRecord
context_object_name = 'tasks'
template_name = 'task/list.html'
def get_context_data(self, **kwargs):
context = {
'task': 'Assets',
'action': 'Create asset',
}
kwargs.update(context)
return super(TaskListView, self).get_context_data(**kwargs)