def get(self): # m_stat = stats.KindStat.gql('WHERE kind_name = :1', 'URLStorage').get() # li = [random.randint(1, m_stat.count) for i in range(10)] # query = URLStorage.gql('WHERE index IN :1', li) # recommendations = [item for item in query] recommendations = recommendAlg.randomAlg() self.render('boredRMD.html', recommendations=recommendations)
def get(self): # m_stat = stats.KindStat.gql('WHERE kind_name = :1', 'URLStorage').get() # n = random.randint(1, m_stat.count) # recommendation = URLStorage.gql('WHERE index = :1', n).get() recommendation = recommendAlg.randomAlg(1)[0] self.redirect('/evaluate?url=' + urllib.quote(recommendation.url))