def spam(siteid): if siteid is None: return [] rows = Page.view('page/spam', key=siteid) pages = list(iter(rows)) if pages: pages.sort(lambda a,b: cmp(a.title, b.title)) return pages
def get_changes(siteid): if siteid is None: return [] rows = Page.view('page/all_pages', key=siteid, limit=50) result = list(iter(rows)) if result: # order revisions result.sort(lambda a,b: cmp(a.updated, b.updated)) result.reverse() return result
def get_page(siteid, name): rows = Page.view('page/by_slug', key=[siteid, name.lower()]) lrows = list(iter(rows)) if lrows: return lrows[0] return None