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)
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)