def rename(self): doc_id = self.request.get('doc_id', None) new_name = self.request.get('new_name', None) if new_name: doc = Document.get(doc_id) doc.Name = new_name doc.put() self._renderList()
def get(self, doc_id): doc = Document.get(doc_id) if doc: self.response.headers['Content-Type'] = str(doc.Mime) self.response.out.write(doc.Contents) return else: print "failed."
def _renderList(self): self.context['docs'] = Document.query() self.render('/admin/utils/docs_list')
def post(self): doc = Document() doc.stuff(self.request) doc.put() self.redirect('/admin/utils/docs')
def get(self): self.context['docs'] = Document.query() self.render('/admin/utils/docs_main')