예제 #1
0
 def get(self, request):
     if request.user.is_authenticated:
         cardzip = {}
         user = UserProfile.objects.get(username=request.user.username)
         cards = user.user_card.all().order_by('id')
         for card in cards:
             if card.is_binded == True:
                 cardzip[card] = '已绑定'
             else:
                 cardzip[card] = '可绑定'
         return render(request, 'profilecard.html', {
             'cards': cards,
             'cardzip': cardzip
         })
     return render(request, 'login.html', {'captcha': captcha()})
예제 #2
0
def bindCard(request):
    if request.user.is_authenticated:
        all_money = request.POST.get('all_money', '')
        all_id = request.POST.get('all_id', '')
        user = UserProfile.objects.get(username=request.user.username)
        cards = user.user_card.all().order_by('id')
        is_bind = []
        not_bind = []
        for card in cards:
            if card.is_binded == True:
                is_bind.append(card)
            else:
                not_bind.append(card)
        return render(
            request, 'bindcard.html', {
                'is_bind': is_bind,
                'not_bind': not_bind,
                'cards': cards,
                'all_money': all_money,
                'all_id': all_id
            })
    return render(request, 'login.html', {'captcha': captcha()})
예제 #3
0
 def get(self, request):
     if request.user.is_authenticated:
         return render(request, 'opencard.html', {})
     return render(request, 'login.html', {'captcha': captcha()})
예제 #4
0
def getBank(request):
    if request.user.is_authenticated:
        # 如果没有登录用户 则返回到登录界面
        return render(request, 'index_b.html', {})
    return render(request, 'login.html', {'captcha': captcha()})
예제 #5
0
 def get(self, request):
     if request.user.is_authenticated:
         user = UserProfile.objects.get(username=request.user.username)
         cards = user.user_card.all().order_by('id')
         return render(request, 'cancel.html', {'cards': cards})
     return render(request, 'login.html', {'captcha': captcha()})
예제 #6
0
def contact(request):
    if request.user.is_authenticated:
        return render(request, 'contact.html', {})
    return render(request, 'login.html', {'captcha': captcha()})