def get(self): count = int(self.get_argument('count', 4)) ans = yield gen.maybe_future(Announcement.list_by_count(count)) raise gen.Return({ 'total': len(ans), 'announcements': [(yield gen.maybe_future(an.to_dict())) for an in ans] })