示例#1
0
def space(request, pageNum=1, articles=None, page='', param=None):
    params = {}
    if not(articles or page):
        try:
            articles = Article.objects.all()
        except KeyError:
            raise Http404

    articles = articles.filter(author=request.user)
    params["where"] = "space"
    curPage = KNOWN_ROOT+"space.html"
    if page: curPage = page
    if param: params.update(param)
    return listing(request, curPage, params,allObjects=articles, pageNum=pageNum)
示例#2
0
def home(request, pageNum=1, articles=None, page='', param=None):

    params = {}

    if not(articles or page):
        try:
            articles = Article.objects.all()
        except KeyError:
            raise Http404


    articles = articles.filter(status__exact=1)

    params['folders'] = STATIC['FOLDER']
    params['topArticles'] = articles.exclude(folder__iexact='notice').order_by('-count')[:10]
    params['topNotices'] = articles.filter(folder__iexact='notice').order_by('-created')[:10]

    articles.exclude(folder__iexact='notice')

    curPage = KNOWN_ROOT+"home.html"
    if page: curPage = page
    if param: params.update(param)
    return listing(request, curPage, params,allObjects=articles, pageNum=pageNum)