예제 #1
0
파일: index.py 프로젝트: UlricQin/me
def tags(tag_name):
    try:
        tag = apis.Tag.get_tag_by_name(unquote(tag_name))
        if not tag:
            from ajax import MSG_NO_TAG
            raise Exception(gettext(MSG_NO_TAG, name=tag_name))
    except:
        abort(404)

    pager = {
        "cur_page": 0,
        "per_page": 10,
    }
    tag.stats.increase("view_count")
    return render_template("tags.html", tag=tag, pager=pager)
예제 #2
0
파일: index.py 프로젝트: hugleecool/me
def tags(tag_name):
    try:
        tag = apis.Tag.get_tag_by_name(unquote(tag_name))
        if not tag:
            from ajax import MSG_NO_TAG
            raise Exception(gettext(MSG_NO_TAG, name=tag_name))
    except:
        abort(404)

    pager = {
        "cur_page": 0,
        "per_page": 10,
    }
    tag.stats.increase("view_count")
    return render_template("tags.html", tag=tag, pager=pager)
예제 #3
0
파일: index.py 프로젝트: UlricQin/me
def index(category_url=None):
    try:
        category_url = category_url and unquote(category_url)
        category = apis.Category.get_by_url(category_url)
        if not category:
            from ajax import MSG_NO_CATEGORY
            raise Exception(gettext(MSG_NO_CATEGORY, id=category_url))

        pager = {
            "cur_page": 0,
            "per_page": category.posts_per_page,
            "group_by": "",
            "is_last_page": False,
        }
    except:
        abort(404)

    category.stats.increase("view_count")
    return render_template("index.html", category=category, pager = pager)
예제 #4
0
파일: index.py 프로젝트: hugleecool/me
def index(category_url=None):
    try:
        category_url = category_url and unquote(category_url)
        category = apis.Category.get_by_url(category_url)
        if not category:
            from ajax import MSG_NO_CATEGORY
            raise Exception(gettext(MSG_NO_CATEGORY, id=category_url))

        pager = {
            "cur_page": 0,
            "per_page": category.posts_per_page,
            "group_by": "",
            "is_last_page": False,
        }
    except:
        abort(404)

    category.stats.increase("view_count")
    return render_template("index.html", category=category, pager=pager)