def get_relationships(self, include_list, item): relationships = {} if 'calls' in include_list: relationships['calls'] = RuntimeCall.query(self.session).filter_by( spec_version=item.spec_version, module_id=item.module_id).order_by('lookup', 'id') if 'events' in include_list: relationships['events'] = RuntimeEvent.query( self.session).filter_by(spec_version=item.spec_version, module_id=item.module_id).order_by( 'lookup', 'id') if 'storage' in include_list: relationships['storage'] = RuntimeStorage.query( self.session).filter_by( spec_version=item.spec_version, module_id=item.module_id).order_by('name') if 'constants' in include_list: relationships['constants'] = RuntimeConstant.query( self.session).filter_by( spec_version=item.spec_version, module_id=item.module_id).order_by('name') if 'errors' in include_list: relationships['errors'] = RuntimeErrorMessage.query( self.session).filter_by( spec_version=item.spec_version, module_id=item.module_id).order_by('name').order_by( RuntimeErrorMessage.index) return relationships
def get_item(self, item_id): spec_version, module_id, event_id = item_id.split('-') return RuntimeEvent.query(self.session).filter_by( spec_version=spec_version, module_id=module_id, event_id=event_id ).first()
def getEventDesc(self, moduleId, eventId): runtimeEvent = RuntimeEvent.query(self.session).filter( and_(RuntimeEvent.module_id == moduleId, RuntimeEvent.event_id == eventId)).first() if runtimeEvent: return runtimeEvent.documentation return ""
def serialize_item(self, item): data = item.serialize() runtime_event = RuntimeEvent.query(self.session).filter_by( module_id=item.module_id, event_id=item.event_id, spec_version=item.spec_version_id).first() data['attributes']['documentation'] = runtime_event.documentation return data
def get_query(self): return RuntimeEvent.query(self.session).order_by( RuntimeEvent.spec_version.asc(), RuntimeEvent.module_id.asc(), RuntimeEvent.event_id.asc())