8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-25 16:33:47 +00:00

[api] Serializer for printer job. Beginning, it's late

This commit is contained in:
Maxime Bombar 2018-10-02 02:53:00 +02:00 committed by root
parent c16655b7a4
commit 361da6bce9

View file

@ -22,6 +22,8 @@
"""Defines the serializers of the API
"""
from re2o.settings import INSTALLED_APPS
from rest_framework import serializers
import cotisations.models as cotisations
@ -30,6 +32,10 @@ import preferences.models as preferences
import topologie.models as topologie
import users.models as users
if "printer" in INSTALLED_APPS:
import printer.models as printer
# The namespace used for the API. It must match the namespace used in the
# urlpatterns to include the API URLs.
API_NAMESPACE = 'api'
@ -711,6 +717,16 @@ class EMailAddressSerializer(NamespacedHMSerializer):
model = users.EMailAddress
fields = ('user', 'local_part', 'complete_email_address', 'api_url')
# PRINTER
class PrintJobSerializer(NamespacedHMSerializer):
"""Serialize the jobs for printer
"""
class Meta:
model = printer.JobWithOptions
fields = ('file', 'filename', 'status', 'starttime', 'endtime', 'api_url')
# SERVICE REGEN