replace_event_id)
from app.api.helpers.helpers import save_db_model, get_object_in_event, \
    model_custom_form, requires_auth, parse_args
from app.api.helpers.special_fields import SessionLanguageField, SessionStateField
from app.api.helpers.utils import PAGINATED_MODEL, PaginatedResourceBase, ServiceDAO, \
    PAGE_PARAMS, POST_RESPONSES, PUT_RESPONSES, SERVICE_RESPONSES
from app.api.helpers.utils import Resource, ETAG_HEADER_DEFN

api = Namespace('sessions', description='Sessions', path='/')

# Create models
SESSION_TRACK = api.model(
    'SessionTrack', {
        'id': fields.Integer(required=True),
        'name': fields.String(),
        'color': fields.Color(),
        'font_color': fields.Color(),
    })

SESSION_SPEAKER = api.model(
    'SessionSpeaker', {
        'id': fields.Integer(required=True),
        'name': fields.String(),
        'organisation': fields.String(),
        'city': fields.String(),
        'short_biography': fields.String(),
        'long_biography': fields.String(),
        'heard_from': fields.String(),
        'speaking_experience': fields.String(),
        'sponsorship_required': fields.String(),
        'short_biography': fields.String(),
from app.api.helpers.utils import PAGINATED_MODEL, PaginatedResourceBase, ServiceDAO, \
    PAGE_PARAMS, POST_RESPONSES, PUT_RESPONSES, SERVICE_RESPONSES
from app.api.helpers.utils import Resource, ETAG_HEADER_DEFN

api = Namespace('tracks', description='Tracks', path='/')

TRACK_SESSION = api.model('TrackSession', {
    'id': fields.Integer(required=True),
    'title': fields.String(),
})

TRACK = api.model('Track', {
    'id': fields.Integer(required=True),
    'name': fields.String(required=True),
    'description': fields.String(),
    'color': fields.Color(required=True),
    'track_image_url': fields.Upload(),
    'location': fields.String(),
    'sessions': fields.List(fields.Nested(TRACK_SESSION)),
})

TRACK_PAGINATED = api.clone('TrackPaginated', PAGINATED_MODEL, {
    'results': fields.List(fields.Nested(TRACK))
})

TRACK_POST = api.clone('TrackPost', TRACK)
del TRACK_POST['id']
del TRACK_POST['sessions']


# Create DAO
Beispiel #3
0
from app.api.helpers.helpers import (can_create, can_update, can_delete)
from app.api.helpers.helpers import save_db_model, get_object_in_event, \
    model_custom_form, requires_auth, parse_args
from app.api.helpers.special_fields import SessionLanguageField, SessionStateField
from app.api.helpers.utils import PAGINATED_MODEL, PaginatedResourceBase, ServiceDAO, \
    PAGE_PARAMS, POST_RESPONSES, PUT_RESPONSES, SERVICE_RESPONSES
from app.api.helpers.utils import Resource, ETAG_HEADER_DEFN

api = Namespace('sessions', description='Sessions', path='/')

# Create models
SESSION_TRACK = api.model(
    'SessionTrack', {
        'id': fields.Integer(required=True),
        'name': fields.String(),
        'color': fields.Color(),
    })

SESSION_SPEAKER = api.model(
    'SessionSpeaker', {
        'id': fields.Integer(required=True),
        'name': fields.String(),
        'organisation': fields.String(),
        'city': fields.String(),
        'heard_from': fields.String(),
        'speaking_experience': fields.String(),
        'sponsorship_required': fields.String()
    })

SESSION_MICROLOCATION = api.model('SessionMicrolocation', {
    'id': fields.Integer(required=True),
    PAGE_PARAMS, POST_RESPONSES, PUT_RESPONSES, SERVICE_RESPONSES
from app.api.helpers.utils import Resource, ETAG_HEADER_DEFN

api = Namespace('tracks', description='Tracks', path='/')

TRACK_SESSION = api.model('TrackSession', {
    'id': fields.Integer(required=True),
    'title': fields.String(),
})

TRACK = api.model(
    'Track', {
        'id': fields.Integer(required=True),
        'name': fields.String(required=True),
        'description': fields.String(),
        'color': fields.Color(required=True),
        'font_color': fields.Color(),
        'track_image_url': fields.Upload(),
        'location': fields.String(),
        'sessions': fields.List(fields.Nested(TRACK_SESSION)),
    })

TRACK_PAGINATED = api.clone('TrackPaginated', PAGINATED_MODEL,
                            {'results': fields.List(fields.Nested(TRACK))})

TRACK_POST = api.clone('TrackPost', TRACK)
del TRACK_POST['id']
del TRACK_POST['sessions']
del TRACK_POST['font_color']