Ejemplo n.º 1
0
 def get(self):
     id = int(self.request.args.get('id'))
     if not id:
         return Response('no id given')
     article = Article.get_by_id(id)
     if not article:
         return Response('no article found')
     article.delete()
     return self.redirect('/admin/articles?del=1')
Ejemplo n.º 2
0
 def get(self):
     ServeBasics.get(self)
     id = int(self.request.args.get('id'))
     if not id:
         return Response('no id')
     
     article = Article.get_by_id(id)
     if not article:
         return Response('no article found')
     
     self.context['article'] = article
     return self.render_response('article.html', **self.context)