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
Beispiel #2
0
 def get_item(self, item_id):
     spec_version, module_id, name = item_id.split('-')
     return RuntimeConstant.query(self.session).filter_by(
         spec_version=spec_version,
         module_id=module_id,
         name=name
     ).first()
 def get_query(self):
     return RuntimeConstant.query(self.session).order_by(
         RuntimeConstant.spec_version.desc(),
         RuntimeConstant.module_id.asc(), RuntimeConstant.name.asc())