def post(self): if self.user: url = self.request.get('url') points = gmp_rules.worth_points(url, self.user) rating = self.store_rating_data() self.gain_points(points) gmp_rules.worth_points(url, self.user, True) #update cache self.render('submitted_review.html', item=rating) else: self.render('welcome.html')
def post(self): if self.user: url = self.request.get('url') points = gmp_rules.worth_points(url, self.user) rating = self.store_rating_data() self.gain_points(points) gmp_rules.worth_points(url, self.user, True) #update cache self.render('submitted_review.html', item = rating) else: self.render('welcome.html')
def get(self): if self.user: url = self.request.get('url') permit = self.check_X_Frame_Options(url) points = gmp_rules.worth_points(url, self.user) url_info = URLStorage.gql('WHERE url = :1', url).get() expertise_rmds = recommendAlg.expertiseRecommend(self.user.user_id) sparse_rmds = recommendAlg.sparseRecommend(self.user.user_id) diff_rmds = recommendAlg.diffRecommend(self.user.user_id) self.render('evaluate.html', url = url, permit = permit, points = points, url_info = url_info, expertise_rmds = expertise_rmds, sparse_rmds = sparse_rmds, diff_rmds = diff_rmds) else: self.render('welcome.html')
def get(self): if self.user: url = self.request.get('url') permit = self.check_X_Frame_Options(url) points = gmp_rules.worth_points(url, self.user) url_info = URLStorage.gql('WHERE url = :1', url).get() expertise_rmds = recommendAlg.expertiseRecommend(self.user.user_id) sparse_rmds = recommendAlg.sparseRecommend(self.user.user_id) diff_rmds = recommendAlg.diffRecommend(self.user.user_id) self.render('evaluate.html', url=url, permit=permit, points=points, url_info=url_info, expertise_rmds=expertise_rmds, sparse_rmds=sparse_rmds, diff_rmds=diff_rmds) else: self.render('welcome.html')
def get_reward_points(url, user): return gmp_rules.worth_points(url, user)