@db_api.api_context_manager.reader
def _refresh_from_db(ctx, cache):
 with db_api.api_context_manager.reader.connection.using(ctx) as conn:
  sel = sa.select([_RC_TBL.c.id, _RC_TBL.c.name])
  res = conn.execute(sel).fetchall()
  cache.id_cache = {r[1]: r[0] for r in res}
  cache.str_cache = {r[0]: r[1] for r in res}

@ db_api . api_context_manager . reader def _refresh_from_db ( ctx , cache ) : with db_api . api_context_manager . reader . connection . using ( ctx ) as conn : sel = sa . select ( [ _RC_TBL . c . id , _RC_TBL . c . name ] ) res = conn . execute ( sel ) . fetchall ( ) cache . id_cache = { r [ 1 ] : r [ 0 ] for r in res } cache . str_cache = { r [ 0 ] : r [ 1 ] for r in res }
grabs all custom resource classes from the db table and populates the supplied cache objects internal integer and string identifier dicts .