Esempio n. 1
0
 def get(self):
         #We are using a NoSQL DB so will be refraining fom writing GQL
         #query for all Question objects in DB
         user=users.get_current_user()
         query=Question.query()
         #fetch them
         questions=query.fetch()
         #Values we will be passing to the view (of MVC)
         vals={'current_user':user,'questions':questions}
         #get the page template suitable for this page
         template=jinjaEnv.get_template('performance.html')
         #render the values into the template and put it in the output stream of the RequestHandler
         self.response.out.write(template.render(vals))
 def addTasks(self):
         all_questions=Question.query().fetch()
         for question in all_questions:
                 taskqueue.add(queue_name='estimatorQueue',url='/estim/admin/tasks/calculateparams',params={'qid':str(question.key.id())})