forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.py
More file actions
32 lines (26 loc) · 778 Bytes
/
services.py
File metadata and controls
32 lines (26 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from marshmallow import validate
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Schema
from app.api.helpers.utilities import dasherize
from utils.common import use_defaults
@use_defaults()
class ServiceSchema(Schema):
"""
API Schema for Service Model
"""
class Meta:
"""
Meta class for Service API schema
"""
type_ = 'service'
self_view = 'v1.service_detail'
self_view_kwargs = {'id': '<id>'}
self_view_many = 'v1.service_list'
inflect = dasherize
id = fields.Str(dump_only=True)
name = fields.Str(
default="track",
validate=validate.OneOf(
choices=["microlocation", "session", "speaker", "track", "sponsor"]
),
)