def news(url=None): try: if url: one_news = news_server.get_by_url(url) else: sid = request.args['p'] one_news = news_server.get_by_id(sid) recent_news = news_server.get_recent() tags = news_server.get_all_tags() except Exception, e: return redirect(url_for('main.news_list'))
def news(url=None): try: if url: one_news = news_server.get_by_url(url) else: sid = request.args['p'] one_news = news_server.get_by_id(sid) recent_news = news_server.get_recent() tags = news_server.get_all_tags() return render_template('index/news.html', title = one_news.title, one = one_news, recent_news = recent_news, tags = tags) except Exception, e: return redirect(url_for('main.index'))