示例#1
0
	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()
示例#2
0
	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."
示例#3
0
	def _renderList(self):
		self.context['docs'] = Document.query()
		self.render('/admin/utils/docs_list')
示例#4
0
	def post(self):
		doc = Document()
		doc.stuff(self.request)
		doc.put()
		self.redirect('/admin/utils/docs')
示例#5
0
	def get(self):
		self.context['docs'] = Document.query()
		self.render('/admin/utils/docs_main')