forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.py
More file actions
28 lines (21 loc) · 777 Bytes
/
service.py
File metadata and controls
28 lines (21 loc) · 777 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
from flask_rest_jsonapi import ResourceDetail, ResourceList
from app.api.bootstrap import api
from app.api.schema.services import ServiceSchema
from app.models import db
from app.models.service import Service
class ServiceList(ResourceList):
"""
List all services i.e. microlocation, session, speaker, track, sponsor
"""
decorators = (api.has_permission('is_admin', methods="GET"),)
methods = ['GET']
schema = ServiceSchema
data_layer = {'session': db.session, 'model': Service}
class ServiceDetail(ResourceDetail):
"""
service detail by id
"""
decorators = (api.has_permission('is_admin', methods="PATCH"),)
schema = ServiceSchema
methods = ['GET', 'PATCH']
data_layer = {'session': db.session, 'model': Service}