Ejemplo n.º 1
0
 def get(self):
     id = int(self.request.args.get('id'))
     if not id:
         return Response('no id given')
     doc = Document.get_by_id(id)
     if not doc:
         return Response('no doc found')
     doc.delete()
     return self.redirect('/admin/documents?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')
     
     deliverable = Document.get_by_id(id)
     self.context['deliverable'] = deliverable
     
     if not deliverable:
         return Response('no deliverable found')
         
     return self.render_response('deliverable.html', **self.context)
Ejemplo n.º 3
0
 def get(self):
     id = int(self.request.args.get('id'))
     if not id:
         return Response('no id')
     
     doc = Document.get_by_id(id)
     if not doc:
         return Response('no doc found')
     
     r = Response(doc.file)
     r.headers['Content-Type'] = 'binary/octet-stream'
     r.headers['Content-Disposition'] = 'attachment; filename=%s;' % doc.file_name
     return r