mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 08:23:12 +00:00
[Printer] History jobs in API
This commit is contained in:
parent
cc447ba622
commit
69c7140911
2 changed files with 9 additions and 2 deletions
|
@ -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/club', views.ClubMailingView),
|
||||
# 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
|
||||
router.register_view(r'token-auth', views.ObtainExpiringAuthToken)
|
||||
|
||||
|
|
|
@ -673,12 +673,18 @@ class ClubMailingView(generics.ListAPIView):
|
|||
serializer_class = serializers.MailingSerializer
|
||||
|
||||
# PRINTER
|
||||
class JobsView(viewsets.ModelViewSet):
|
||||
class PrintableJobsView(viewsets.ModelViewSet):
|
||||
"""Api Root Jobs
|
||||
"""
|
||||
queryset = printer.JobWithOptions.objects.filter(status='Printable')
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue