mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 20:33:11 +00:00
[api] Serializer for printer job. Beginning, it's late
This commit is contained in:
parent
c16655b7a4
commit
361da6bce9
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue