def save(self, text, *p, **kw): log = getlogger(__name__, self.__class__.__name__, 'save') history = model.WikiPageHistory() history.page_id = self.wp._id history.text = self.wp.text self.wp.text = text redirect (url('./'))
def _lookup(self, *p, **kw): log = getlogger(__name__, self.__class__.__name__, '_lookup') if p: p = list(p) title = p.pop(0) elif 'title' in kw: title = kw['title'] else: title='New Page' title = urllib.unquote(title).decode('utf8') return PageController(title), p
def _lookup(self, *p, **kw): log = getlogger(__name__, self.__class__.__name__, '_lookup') urlmap = { 'history': None, 'comments': None } if p: p=list(p) url = p.pop(0) klass = urlmap.get(url, None) if klass: return klass(self.wp), p raise HTTPNotFound
def __init__(self, title, *p, **kw): super(PageController, self).__init__() log = getlogger(__name__, self.__class__.__name__, '__init__') log.debug('title: %s' % (title)) self.title = title self.wp = model.WikiPage.query.find({'title':title}).first()