コード例 #1
0
ファイル: index.py プロジェクト: Z2Y/CUIT-ACM-Website
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'))
コード例 #2
0
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'))