def get_cursor(tbname,dbname=config.mongo['dbname']): conn = Simple_pymongo.get_instance() db = conn.__getattr__(dbname) cursor = db.__getattr__(tbname) return cursor
def get_db(dbname): conn = Simple_pymongo(config.mongo['hosts']) return conn.__getattr__(dbname)