'query method for speakers list class
:param view_kwargs:
:return:'

def query(self, view_kwargs):

    query_ = self.session.query(Speaker)
    query_ = event_query(self, query_, view_kwargs)
    if view_kwargs.get('user_id'):
        user = safe_query(self, User, 'id', view_kwargs['user_id'], 'user_id')
        query_ = query_.join(User).filter((User.id == user.id))
    if view_kwargs.get('session_id'):
        session = safe_query(self, Session, 'id', view_kwargs['session_id'], 'session_id')
        query_ = Speaker.query.filter(Speaker.sessions.any(id=session.id))
        if (('Authorization' in request.headers) and (not has_access('is_coorganizer', event_id=session.event_id))):
            if (not has_access('is_session_self_submitted', session_id=session.id)):
                query_ = query_.filter(((Session.state == 'approved') or (Session.state == 'accepted')))
    return query_
