def render(self, thing, *a, **kw): timestamp = time.mktime(thing.date.timetuple()) if thing.date else None author = thing.get_author() if author and not author._deleted: author = Wrapped(author).render() else: author = None return ObjectTemplate( dict(author=author, id=str(thing._id), timestamp=timestamp, reason=thing._get('reason'), page=thing.page))
def data(self, thing): editors = [Wrapped(e).render() for e in thing.mayedit] return dict(permlevel=thing.permlevel, editors=editors)
def data(self, trophies): trophies = [Wrapped(t).render() for t in trophies] return dict(trophies=trophies)