Beispiel #1
0
def tags(request, tag):
    page = request.GET.get('page', 1)
    tag = get_object_or_404(Tag, name=tag)
    posts = paginator_objects(
        TaggedItem.objects.get_by_model(Post, tag).order_by('-date'), page)
    archtype = 'tag'
    return render_to_theme(request, 'archive.html', locals())
Beispiel #2
0
def category(request, name):
    page = request.GET.get('page', 1)
    cat = Category.objects.get(slug=name)
    posts = paginator_objects(Post.objects.get_post().filter(category=cat),
                              page)
    archtype = 'category'
    return render_to_theme(request, 'archive.html', locals())
Beispiel #3
0
def search(request):
    page = request.GET.get('page', 1)
    query = escape(request.GET.get('s', ''))
    qd = request.GET.copy()
    if 'page' in qd:
        qd.pop('page')
    posts = None
    if query:
        qset = (Q(title__icontains=query))
        posts = paginator_objects(
            Post.objects.filter(qset, published=True).distinct(), page)
    return render_to_theme(request, 'search.html', locals())
Beispiel #4
0
def search(request):
    page=request.GET.get('page',1)
    query = escape(request.GET.get('s', ''))
    qd = request.GET.copy()
    if 'page' in qd:
        qd.pop('page')
    posts=None
    if query:
        qset = (
            Q(title__icontains=query)
        )
        posts = paginator_objects(Post.objects.filter(qset, published=True).distinct(),page)
    return render_to_theme(request,'search.html',locals())
Beispiel #5
0
def home(request):
    page = request.GET.get('page', 1)
    posts = paginator_objects(Post.objects.get_post(), page)
    ishome = True
    return render_to_theme(request, 'index.html', locals())
Beispiel #6
0
def calendar(request, year, month, day):
    page = request.GET.get('page', 1)
    posts = paginator_objects(Post.objects.get_post_by_day(year, month, day),
                              page)
    archtype = 'calendar'
    return render_to_theme(request, 'archive.html', locals())
Beispiel #7
0
def archives(request, year, month):
    page = request.GET.get('page', 1)
    posts = paginator_objects(Post.objects.get_post_by_year_month(year, month),
                              page)
    archtype = 'archive'
    return render_to_theme(request, 'archive.html', locals())
Beispiel #8
0
def home(request):
    page = request.GET.get('page',1)
    posts = paginator_objects(Post.objects.get_post(),page)
    ishome=True
    return render_to_theme(request,'index.html',locals())
Beispiel #9
0
def calendar(request,year,month,day):
    page=request.GET.get('page',1)
    posts=paginator_objects(Post.objects.get_post_by_day(year,month,day),page)
    archtype='calendar'
    return render_to_theme(request,'archive.html',locals()) 
Beispiel #10
0
def tags(request,tag):
    page=request.GET.get('page',1)
    tag = get_object_or_404(Tag, name =tag)
    posts = paginator_objects(TaggedItem.objects.get_by_model(Post, tag).order_by('-date'),page)
    archtype='tag'
    return render_to_theme(request,'archive.html',locals())
Beispiel #11
0
def category(request,name):
    page=request.GET.get('page',1)
    cat = Category.objects.get(slug=name)
    posts = paginator_objects(Post.objects.get_post().filter(category=cat),page)
    archtype='category'
    return render_to_theme(request,'archive.html',locals())
Beispiel #12
0
def archives(request,year,month):
    page=request.GET.get('page',1)
    posts=paginator_objects(Post.objects.get_post_by_year_month(year,month),page)
    archtype='archive'
    return render_to_theme(request,'archive.html',locals())
Beispiel #13
0
def index(request):
    page = request.GET.get('page',1)
    categories = Category.objects.all()
    posts = paginator_objects(Post.objects.all(),page)
    return render(request,'wap/index.html',locals())