from app.api.helpers.helpers import (requires_auth, can_access, replace_event_id) from app.api.helpers.utils import POST_RESPONSES from app.api.helpers.utils import Resource from app.api.helpers import custom_fields as fields api = Namespace('attendees', description='Attendees', path='/') ATTENDEE = api.model( 'TicketHolder', { 'id': fields.Integer(), 'firstname': fields.String(), 'lastname': fields.String(), 'email': fields.Email(), 'checked_in': fields.Boolean(), 'order': fields.Nested(ORDER, allow_null=False), 'ticket': fields.Nested(TICKET, allow_null=False) }) @api.route('/events/<string:event_id>/attendees/') class AttendeesList(Resource): @requires_auth @replace_event_id @can_access @api.doc('check_in_toggle', responses=POST_RESPONSES) @api.marshal_list_with(ATTENDEE) def get(self, event_id): """Get attendees of the event""" return TicketingManager.get_attendees(event_id)
'copyright': fields.Nested(EVENT_COPYRIGHT, allow_null=True), 'licence_details': fields.Licence(attribute='copyright.licence', allow_null=True), 'schedule_published_on': fields.DateTime(), 'code_of_conduct': fields.String(), 'social_links': fields.List(fields.Nested(SOCIAL_LINK), attribute='social_link'), 'call_for_papers': fields.Nested(EVENT_CFS, allow_null=True), 'version': fields.Nested(EVENT_VERSION), 'has_session_speakers': fields.Boolean(default=False), 'thumbnail': fields.Uri(), 'large': fields.Uri() }) EVENT_COMPLETE = api.clone( 'EventComplete', EVENT, { 'sessions': fields.List(fields.Nested(SESSION), attribute='session'), 'microlocations': fields.List(fields.Nested(MICROLOCATION), attribute='microlocation'), 'tracks': fields.List(fields.Nested(TRACK), attribute='track'), 'sponsors':
}) SPEAKER = api.model( 'Speaker', { 'id': fields.Integer(required=True), 'name': fields.String(required=True), 'photo': fields.Upload(), 'small': fields.Upload(), 'thumbnail': fields.Upload(), 'icon': fields.Upload(), 'short_biography': fields.String(), 'long_biography': fields.String(), 'email': fields.Email(required=True), 'mobile': fields.String(), 'featured': fields.Boolean(), 'website': fields.Uri(), 'twitter': fields.String(), # not sure for now whether uri or string field 'facebook': fields.String(), 'github': fields.String(), 'linkedin': fields.String(), 'organisation': fields.String(required=True), 'position': fields.String(), 'country': fields.String(required=True), 'sessions': fields.List(fields.Nested(SPEAKER_SESSION)), 'city': fields.String(), 'heard_from': fields.String(), 'speaking_experience': fields.String(), 'sponsorship_required': fields.String(), 'gender': fields.String()
'searchable_location_name': fields.String(), 'organizer_name': fields.String(), 'organizer_description': fields.String(), 'state': EventStateField(default='Draft'), 'type': EventTypeField(), 'topic': EventTopicField(), 'sub_topic': EventSubTopicField(), 'privacy': EventPrivacyField(), 'ticket_url': fields.Uri(), 'copyright': fields.Nested(EVENT_COPYRIGHT, allow_null=True), 'schedule_published_on': fields.DateTime(), 'code_of_conduct': fields.String(), 'social_links': fields.List(fields.Nested(SOCIAL_LINK), attribute='social_link'), 'call_for_papers': fields.Nested(EVENT_CFS, allow_null=True), 'version': fields.Nested(EVENT_VERSION), 'has_session_speakers': fields.Boolean(default=False), 'thumbnail': fields.Uri(), 'large': fields.Uri() }) EVENT_COMPLETE = api.clone('EventComplete', EVENT, { 'sessions': fields.List(fields.Nested(SESSION), attribute='session'), 'microlocations': fields.List(fields.Nested(MICROLOCATION), attribute='microlocation'), 'tracks': fields.List(fields.Nested(TRACK), attribute='track'), 'sponsors': fields.List(fields.Nested(SPONSOR), attribute='sponsor'), 'speakers': fields.List(fields.Nested(SPEAKER), attribute='speaker'), 'tickets': fields.List(fields.Nested(TICKET), attribute='tickets'), }) EVENT_PAGINATED = api.clone('EventPaginated', PAGINATED_MODEL, { 'results': fields.List(fields.Nested(EVENT))