本文整理匯總了Python中models.user.UserModel.setTrust方法的典型用法代碼示例。如果您正苦於以下問題:Python UserModel.setTrust方法的具體用法?Python UserModel.setTrust怎麽用?Python UserModel.setTrust使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.user.UserModel
的用法示例。
在下文中一共展示了UserModel.setTrust方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: calc_new_trust
# 需要導入模塊: from models.user import UserModel [as 別名]
# 或者: from models.user.UserModel import setTrust [as 別名]
def calc_new_trust(self):
winner = AnswerModel.get_by_answer_id(self.best_answer_id)
loser = AnswerModel.get_by_answer_id(self.other_answer_id)
new_trust = UserModel.newTrust(winner.userID, loser.userID)
UserModel.setTrust(winner.userID,new_trust[0])
UserModel.setTrust(loser.userID,new_trust[1])
示例2: updateTrust
# 需要導入模塊: from models.user import UserModel [as 別名]
# 或者: from models.user.UserModel import setTrust [as 別名]
def updateTrust(self):
trust = UserModel.getTrust(self.user_id) + ((float(self.rating) * 25.0) - 75.0)
UserModel.setTrust(self.user_id, trust)
示例3: render_adjust_trust
# 需要導入模塊: from models.user import UserModel [as 別名]
# 或者: from models.user.UserModel import setTrust [as 別名]
def render_adjust_trust(self, uid, trust):
UserModel.setTrust(uid, trust)
return render_template('trustdata_start.html', data=UserModel.get_all())