

@classmethod
@gen.engine
def find_one_async(klass, *args, **kwargs):
    "\n        Find a single object in the database, takes standard PyMongo-style\n        input parameters (non-blocking)::\n\n            thisUser = yield gen.Task(User.find_one,{'username':username}) #Gets a specific user from the DB\n\n        "
    from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE
    klass.collection_name = kwargs.__name__
    cb = kwargs['callback']
    del kwargs['callback']
    if DATABASE:
        if BACKEND_COLLECTION:
            this_collection = BACKEND_COLLECTION(DATABASE, klass)
            ret_obj = (yield gen.Task(this_collection.find_one, *args, **kwargs))
            cb(ret_obj)

dataset/ETHPy150Open lonelycode/Mojo/Mojo/ObjectMapper/ModelPrototype.py Model.find_one_async/VarMisuse@41/138 `klass`->`kwargs`