예제 #1
0
def charge_logs(request, page = "1"):
    charge_n_logs = Charge_normal_logs.objects.filter(user = request.user )
    log_list = DBUtils.divide_page(charge_n_logs, 10, int(page))
    log_list.count = int(math.ceil(charge_n_logs.count() / float( '%.2f' % 10)));
    return render_to_response('chargelogs.html',{'current_app' : current_app, 'current_tab' : request.path,
                                                 'log_list' : log_list,
                                                   },context_instance=RequestContext(request))
예제 #2
0
def qs_mine_page(request, page = 1):
    if request.user.is_authenticated():
        myQuestions = Question.objects.filter(user=request.user) #@UndefinedVariable
        for question in myQuestions:
            question.anwser_count = question.anwser_set.all().count();
        myquest_list = DBUtils.divide_page(myQuestions,10, page)
        return render_to_response('faqs_mytasks.html', {'myquest_list':myquest_list },context_instance=RequestContext(request) )
    else:
        return HttpResponseRedirect("/login/")
예제 #3
0
def charge_logs(request, page="1"):
    charge_n_logs = Charge_normal_logs.objects.filter(user=request.user)
    log_list = DBUtils.divide_page(charge_n_logs, 10, int(page))
    log_list.count = int(math.ceil(charge_n_logs.count() / float('%.2f' % 10)))
    return render_to_response('chargelogs.html', {
        'current_app': current_app,
        'current_tab': request.path,
        'log_list': log_list,
    },
                              context_instance=RequestContext(request))
예제 #4
0
def qs_tag_quest(request, *args, **kwargs):
    tagId = kwargs.pop('id',None)
    page = kwargs.pop('page',1)
    if tagId != None:
        question_tag = Question_Tag.objects.get(id=int(tagId))        #@UndefinedVariable
        tag_quests = Question.objects.filter(tags=question_tag) #@UndefinedVariable
        for tag_quest in tag_quests:
            tag_quest.anwser_count = tag_quest.anwser_set.all().count();
        question_list = DBUtils.divide_page(tag_quests, 10, int(page))
    return render_to_response('faqs_tag_quest.html',{'question_list':question_list,'question_tag':question_tag},context_instance=RequestContext(request))
예제 #5
0
def trends_page(request, page = 1):
    infomations = Information.objects.all(); #@UndefinedVariable
    info_list = DBUtils.divide_page(infomations,10, page)
    return render_to_response('trends.html',{'info_list': info_list},context_instance=RequestContext(request))
예제 #6
0
def qs_quest_page(request, page=1 ,sort=0 , type=0 ): 
    questions = ctrls.getQuestionsDynamicSql( sort, type )
    question_list = DBUtils.divide_page(questions , 10, page)
    return render_to_response('faqs_questions.html',{'question_list':question_list , 'sort' : sort ,'type' : type},context_instance=RequestContext(request))
예제 #7
0
def qs_recent_page(request, page = 1):
    questions = Question.objects.all() #@UndefinedVariable
    for question in questions:
        question.anwser_count = question.anwser_set.all().count();
    question_list = DBUtils.divide_page(questions,10, page)
    return render_to_response('faqs_recent.html', {'question_list':question_list},context_instance=RequestContext(request)) 
예제 #8
0
def trends_page(request, page=1):
    infomations = Information.objects.all()
    #@UndefinedVariable
    info_list = DBUtils.divide_page(infomations, 10, page)
    return render_to_response('trends.html', {'info_list': info_list},
                              context_instance=RequestContext(request))