@login_required
def show(request, page):
    if request.user.is_superuser:
        guestbooks = Guestbook.objects.filter().order_by('-date', '-id')
        (guestbooks, pageList, paginator, page) = djangoPage(guestbooks, page, PAGE_NUM)
        replys = Reply.objects.filter(guestbookname=request.user.username).order_by('-date', '-id')
        offset = (PAGE_NUM * (page - 1))
        return render(request, 'guestbook/showall.html', context=locals())
    guestbooks = Guestbook.objects.filter(username=request.user.username).order_by('-date', '-id')
    (guestbooks, pageList, paginator, page) = djangoPage(guestbooks, page, PAGE_NUM)
    replys = Reply.objects.filter(guestbookname=request.user.username).order_by('-date', '-id')
    offset = (PAGE_NUM * (page - 1))
    return render(request, 'guestbook/show.html', context=locals())
@login_required
def show(request, page):
    if request.user.is_superuser:
        guestbooks = Guestbook.objects.filter().order_by('-date', '-id')
        (guestbooks, pageList, paginator, page) = djangoPage(guestbooks, page, PAGE_NUM)
        replys = Reply.objects.filter(guestbookname=request.user.username).order_by('-date', '-id')
        offset = (PAGE_NUM * (page - 1))
        return render(request, 'guestbook/showall.html', context=locals())
    guestbooks = Guestbook.objects.filter(username=request.user.username).order_by('-date', '-id')
    (guestbooks, pageList, paginator, page) = djangoPage(guestbooks, page, PAGE_NUM)
    replys = Reply.objects.filter(guestbookname=request.user.username).order_by('-date', '-id')
    offset = (PAGE_NUM * (page - 1))
    return render(request, 'guestbook/show.html', context=locals())