8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-28 15:42:25 +00:00

[Printer] History jobs in API

This commit is contained in:
Maxime Bombar 2018-10-10 02:26:51 +02:00 committed by root
parent cc447ba622
commit 69c7140911
2 changed files with 9 additions and 2 deletions

View file

@ -120,7 +120,8 @@ router.register_view(r'dns/reverse-zones', views.DNSReverseZonesView),
router.register_view(r'mailing/standard', views.StandardMailingView), router.register_view(r'mailing/standard', views.StandardMailingView),
router.register_view(r'mailing/club', views.ClubMailingView), router.register_view(r'mailing/club', views.ClubMailingView),
# PRINTER # PRINTER
router.register_viewset(r'printer/jobs', views.JobsView) router.register_viewset(r'printer/printable-jobs', views.PrintableJobsView)
router.register_viewset(r'printer/history-jobs', views.HistoryJobsView)
# TOKEN AUTHENTICATION # TOKEN AUTHENTICATION
router.register_view(r'token-auth', views.ObtainExpiringAuthToken) router.register_view(r'token-auth', views.ObtainExpiringAuthToken)

View file

@ -673,12 +673,18 @@ class ClubMailingView(generics.ListAPIView):
serializer_class = serializers.MailingSerializer serializer_class = serializers.MailingSerializer
# PRINTER # PRINTER
class JobsView(viewsets.ModelViewSet): class PrintableJobsView(viewsets.ModelViewSet):
"""Api Root Jobs """Api Root Jobs
""" """
queryset = printer.JobWithOptions.objects.filter(status='Printable') queryset = printer.JobWithOptions.objects.filter(status='Printable')
serializer_class = serializers.PrintJobSerializer serializer_class = serializers.PrintJobSerializer
class HistoryJobsView(viewsets.ModelViewSet):
"""Api Root Jobs
"""
queryset = printer.JobWithOptions.objects.exclude(status='Printable').exclude(status='Pending')
serializer_class = serializers.PrintJobSerializer
# TOKEN AUTHENTICATION # TOKEN AUTHENTICATION