Ejemplo n.º 1
0
 def get(self, pubmed_id):
     self.setTemplate('studyview.html')
     study = Study.get_by_key_name(pubmed_id)
     if study is None:
         self.redirect('/studies/')
         return
     self.out(study=study)
Ejemplo n.º 2
0
    def post(self, pubmed_id):
        self.setTemplate('studyview.html')
        study = Study.get_by_key_name(pubmed_id)
        if study is None:
            self.redirect('/studies/')
            return

        comment = Comment()
        comment.study = study.key()
        comment.body = self.request.get("comment")
        comment.user = UserData.current()
        comment.date = datetime.now()
        comment.put()

        self.out(study=study)