academon/api/views/urls.py

46 lines
2.2 KiB
Python
Raw Normal View History

from django.views import View
from django.http import JsonResponse
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse_lazy
2022-09-18 16:45:35 +00:00
from django.templatetags.static import static
class VesselsDataTableURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
2022-09-18 16:45:35 +00:00
return JsonResponse(reverse_lazy("core:admin_vessels_datatable"), safe=False)
class VesselsEditURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_vessels_edit", kwargs["id"]), safe=False)
class VesselsDeleteURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_vessels_delete", kwargs["id"]), safe=False)
2022-09-20 14:02:39 +00:00
class ReplicationSourcesDataTableURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_sources_datatable"), safe=False)
class ReplicationSourcesEditURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_sources_edit", kwargs["id"]), safe=False)
class ReplicationSourcesDeleteURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_sources_delete", kwargs["id"]), safe=False)
class ReplicationTargetsDataTableURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_targets_datatable"), safe=False)
class ReplicationTargetsEditURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_targets_edit", kwargs["id"]), safe=False)
class ReplicationTargetsDeleteURLView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
return JsonResponse(reverse_lazy("core:admin_replication_targets_delete", kwargs["id"]), safe=False)
2022-09-18 16:45:35 +00:00
class StaticsURLView(View):
def get(self, request, *args, **kwargs):
return JsonResponse(static(request.GET["file"]), safe=False)