コード例 #1
0
ファイル: controllers.py プロジェクト: bkolobara/indico
    def _process_args(self):
        data = request.json
        self.object = None
        if 'categId' in data:
            self.object = Category.get_one(data['categId'])
        elif 'contribId' in data:
            self.object = Contribution.get_one(data['contribId'])
        elif 'sessionId' in data:
            self.object = Session.get_one(data['sessionId'])
        elif 'confId' in data:
            self.object = Event.get_one(data['confId'])

        if self.object is None:
            raise BadRequest
コード例 #2
0
ファイル: controllers.py プロジェクト: EnterStudios/indico
    def _checkParams(self):
        data = request.json
        self.object = None
        if 'categId' in data:
            self.object = Category.get_one(data['categId'])
        elif 'contribId' in data:
            self.object = Contribution.get_one(data['contribId'])
        elif 'sessionId' in data:
            self.object = Session.get_one(data['sessionId'])
        elif 'confId' in data:
            self.object = Event.get_one(data['confId'])

        if self.object is None:
            raise BadRequest
コード例 #3
0
ファイル: util.py プロジェクト: HodardCodeclub/IwacuEvent
def obj_deref(ref):
    """Returns the object identified by `ref`"""
    from indico_livesync.models.queue import EntryType
    if ref['type'] == EntryType.category:
        return Category.get_one(ref['category_id'])
    elif ref['type'] == EntryType.event:
        return Event.get_one(ref['event_id'])
    elif ref['type'] == EntryType.session:
        return Session.get_one(ref['session_id'])
    elif ref['type'] == EntryType.contribution:
        return Contribution.get_one(ref['contrib_id'])
    elif ref['type'] == EntryType.subcontribution:
        return SubContribution.get_one(ref['subcontrib_id'])
    else:
        raise ValueError('Unexpected object type: {}'.format(ref['type']))
コード例 #4
0
ファイル: util.py プロジェクト: indico/indico-plugins
def obj_deref(ref):
    """Returns the object identified by `ref`"""
    from indico_livesync.models.queue import EntryType
    if ref['type'] == EntryType.category:
        return Category.get_one(ref['category_id'])
    elif ref['type'] == EntryType.event:
        return Event.get_one(ref['event_id'])
    elif ref['type'] == EntryType.session:
        return Session.get_one(ref['session_id'])
    elif ref['type'] == EntryType.contribution:
        return Contribution.get_one(ref['contrib_id'])
    elif ref['type'] == EntryType.subcontribution:
        return SubContribution.get_one(ref['subcontrib_id'])
    else:
        raise ValueError('Unexpected object type: {}'.format(ref['type']))
コード例 #5
0
ファイル: display.py プロジェクト: pmart123/indico
 def _checkParams(self, params):
     RHConferenceBaseDisplay._checkParams(self, params)
     self.session = Session.get_one(request.view_args['session_id'],
                                    is_deleted=False)
コード例 #6
0
ファイル: __init__.py プロジェクト: bkolobara/indico
 def _process_args(self):
     RHManageSessionsBase._process_args(self)
     self.session = Session.get_one(request.view_args['session_id'], is_deleted=False)
コード例 #7
0
ファイル: __init__.py プロジェクト: pmart123/indico
 def _checkParams(self, params):
     RHManageSessionsBase._checkParams(self, params)
     self.session = Session.get_one(request.view_args['session_id'],
                                    is_deleted=False)
コード例 #8
0
ファイル: __init__.py プロジェクト: tobiashuste/indico
 def _process_args(self):
     RHManageSessionsBase._process_args(self)
     self.session = Session.get_one(request.view_args['session_id'],
                                    is_deleted=False)
コード例 #9
0
 def _checkParams(self, params):
     RHConferenceBaseDisplay._checkParams(self, params)
     self.session = Session.get_one(request.view_args['session_id'], is_deleted=False)
コード例 #10
0
ファイル: display.py プロジェクト: qroques/indico
 def _process_args(self):
     RHDisplayEventBase._process_args(self)
     self.session = Session.get_one(request.view_args['session_id'],
                                    is_deleted=False)
コード例 #11
0
ファイル: display.py プロジェクト: nop33/indico
 def _process_args(self):
     RHDisplayEventBase._process_args(self)
     self.session = Session.get_one(request.view_args['session_id'], is_deleted=False)
コード例 #12
0
ファイル: __init__.py プロジェクト: OmeGak/indico
 def _checkParams(self, params):
     RHManageSessionsBase._checkParams(self, params)
     self.session = Session.get_one(request.view_args['session_id'], is_deleted=False)
コード例 #13
0
ファイル: display.py プロジェクト: harshdchandel/indico
 def _process_args(self):
     RHConferenceBaseDisplay._process_args(self)
     self.session = Session.get_one(request.view_args['session_id'],
                                    is_deleted=False)