def get(self, catagory=0): spec = dict() if catagory: spec.update(catagory=int(catagory)) news_list = News.news(spec=spec) self.render(news_list=news_list)
def get(self, catagory): if catagory == 'startup': catagory = const.NEWS_CATAGORY.STARTUP else: catagory = const.NEWS_CATAGORY.NEWS spec = dict(catagory=catagory) title = const.NEWS_CATAGORY_CN.get(catagory) li = News.news(spec=spec) self.render(li=li, title=title)