def post(self): dao = UserDAO(self.db) cursor = yield (dao.create()) if not cursor.closed: self.write('closing cursor') cursor.close() self.finish()