Ejemplo n.º 1
0
 def post(self, comment):
     """ Edit comment via POST """
     comment = Comment.get(comment)
     if UserData.current().user_id == comment.user.user_id:
         comment.body = self.request.get('value')
         comment.put()
         self.response.write(comment.body)
Ejemplo n.º 2
0
 def get(self, comment):
     """ Delete comment via GET """
     user = UserData.current()
     comment = Comment.get(comment)
     if user.developer or user.moderator \
             or user.user_id == comment.user.user_id:
         comment.delete()
         self.response.write("Deleted")
Ejemplo n.º 3
0
    def post(self, gene):
        gene = Gene.gql("WHERE name = :1", gene).get()

        comment = Comment()
        comment.gene = gene.key()
        comment.body = self.request.get("comment")
        comment.user = UserData.current().user_id #users.get_current_user()
        comment.date = datetime.now()
        comment.put()

        self.out(gene=gene)
Ejemplo n.º 4
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)