def load_by_card_number(self, card_number): ret = db().select(self.className, {"card_number": card_number}, where="card_number=$card_number") return single_result(ret)
def load_by_username(self, username): ret = db().select(self.className, {'username': username}, where="username=$username") return single_result(ret)
def get_by_user_id(self, user_id): ret = db().select(self.className, {"user_id": user_id}, where="user_id=$user_id") return single_result(ret)