我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用google.appengine.ext.ndb.toplevel()。
def get(self): acct = Account.get_by_id(users.get_current_user().user_id()) acct.view_counter += 1 acct.put_async() # Ignoring the Future this returns # ...read something else from Datastore... self.response.out.write('Content of the page') # This is actually redundant, since the `get` decorator already handles it, but # for demonstration purposes, you can also make the entire app toplevel with # the following.