def find(session, extension_id): extension_row = (session.query(ExtensionSchema).filter( ExtensionSchema.id == extension_id).first()) if not extension_row: return None return db_converter.to_model(extension_row)
def find(session, extension_id): extension_row = (session.query(ExtensionSchema) .filter(ExtensionSchema.id == extension_id) .first()) if not extension_row: return None return db_converter.to_model(extension_row)
def _rows_to_extension_model(extension_rows): if not extension_rows: return [] extensions = [] for extension_row in extension_rows: extensions.append(db_converter.to_model(extension_row)) return extensions
def find_by_exten_context(session, exten, context): extension_row = (session.query(ExtensionSchema).filter( ExtensionSchema.exten == exten).filter( ExtensionSchema.context == context).first()) if not extension_row: return None return db_converter.to_model(extension_row)
def get_by_exten_context(session, exten, context): res = (session.query(ExtensionSchema).filter( ExtensionSchema.exten == exten).filter( ExtensionSchema.context == context)).first() if not res: raise ElementNotExistsError('Extension', exten=exten, context=context) return db_converter.to_model(res)
def find_by_exten_context(session, exten, context): extension_row = (session.query(ExtensionSchema) .filter(ExtensionSchema.exten == exten) .filter(ExtensionSchema.context == context) .first()) if not extension_row: return None return db_converter.to_model(extension_row)
def get_by_exten_context(session, exten, context): res = (session.query(ExtensionSchema) .filter(ExtensionSchema.exten == exten) .filter(ExtensionSchema.context == context) ).first() if not res: raise errors.not_found('Extension', exten=exten, context=context) return db_converter.to_model(res)
def get_by_exten_context(session, exten, context): res = (session.query(ExtensionSchema) .filter(ExtensionSchema.exten == exten) .filter(ExtensionSchema.context == context) ).first() if not res: raise ElementNotExistsError('Extension', exten=exten, context=context) return db_converter.to_model(res)
def get(session, extension_id): row = _fetch_extension_row(session, extension_id) return db_converter.to_model(row)