def get(self): key=self.request.get('key') entry=db.get(key) deleteEntry(entry) index.doindex(self)
def get(self): key=self.request.get('topkey') if key: entry=Entry.get(key) else: index.doindex(self) return entryform=EntryForm() editkey=self.request.get('editkey') tags='' if editkey: editentry=Entry.get(editkey) if editentry: if editentry.type=='Text': editentry.text=editentry.text.replace('<br />', '\n') entryform=EntryForm(instance=editentry) for tagged in editentry.tagedEntries: tags+=tagged.tag.name+',' tags=tags[0:-1] #takes off last char deletekey=self.request.get('deletekey') deleted=False if deletekey: deleteentry=Entry.get(deletekey) if deleteentry: delete.deleteEntry(deleteentry) deleted=True template_values = { 'editkey':editkey, 'up':up(entry), 'deleleted':deleted, 'comments':commentsHtml(top=entry,entry=entry), 'entryform':entryform, 'topkey':key, 'tags':tags } template_values.update(util.loadstd(self)) path = os.path.join(os.path.dirname(__file__), '../html/comments.html') self.response.out.write(template.render(path, template_values))
def post(self): util.saveEntry(self) # finish up index.doindex(self)