def writeContent(self): wr = self.writeln qs = self.request().fields() id = qs.get('id') if self.request()._environ.get('REQUEST_METHOD') == 'POST': form = qs ntype, redir = 'news', "News" if form.get('annual') == '1': ntype, redir = 'annual', "Annual" delete_news_item(id, ntype) self.response().sendRedirect(redir) else: wr('<form action="News_Delete" method="POST">') wr(hidden('id', id)) if qs.get('annual') == '1': wr(hidden('annual', '1')) nii = get_news_item(id) wr('<h1>Are you sure you want to delete this news item?</h1>') wr('<h3>You cannot undo this operation.</h3>') wr('<h2>%s</h2>' % (nii.get('headline'))) wr('<p>%s</p>' % (nii.get('description'))) wr(submit('Delete News Item')) wr('</form>')
def writeContent(self): wr = self.writeln qs = self.request().fields() id = qs.get('id') if self.request()._environ.get('REQUEST_METHOD') == 'POST': form = qs delete_news_item(id, "actionitem") self.response().sendRedirect("Action") else: wr('<form action="Action_Delete" method="POST">') wr(hidden('id', id)) nii = get_news_item(id) wr('<h1>Are you sure you want to delete this action item?</h1>') wr('<h3>You cannot undo this operation.</h3>') wr('<h2>%s</h2>' % (nii.get('headline'))) wr('<p>%s</p>' % (nii.get('description'))) wr(submit('Delete Action Item')) wr('</form>')