def document_view(self):
# Get the document
document = self.request.root.properties[self.request.matchdict["doc_code"]]
if type(document) is not Document:
self.request.session.flash("Document does not exist!", "error")
return HTTPFound(location=self.request.route_path("admin_settings"))
if "submit" in self.request.POST:
document.main_body = self.request.POST["body"]
to_remove = []
for point in document.headline_points:
to_remove.append(point)
for point in to_remove:
document.headline_points.remove(point)
for highpoint in self.request.params.getall("highpoint"):
document.headline_points.append(highpoint)
return {
"document": document,
}
评论列表
文章目录