当前位置: 首页>>代码示例>>Python>>正文


Python utils.render函数代码示例

本文整理汇总了Python中portal.views.utils.render函数的典型用法代码示例。如果您正苦于以下问题:Python render函数的具体用法?Python render怎么用?Python render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了render函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pay_rent_detail

def pay_rent_detail(request, rent_uuid):
    try:
        renter = models.LandlordRenterInfo.objects.get(uuid=rent_uuid)
        return utils.render('pay/detail_landlord.html', {'renter': renter})
    except models.LandlordRenterInfo.DoesNotExist:
        # Else use an renter detail template
        renter = get_object_or_404(models.RenterRentProfile, uuid=rent_uuid)
        return utils.render('pay/detail_renter.html', {'renter': renter})
开发者ID:nidongliang,项目名称:payme,代码行数:8,代码来源:pay_rent.py

示例2: form_valid

 def form_valid(self, form):
     data = form.cleaned_data
     users = models.Merchant.objects.filter(username=data['username'])
     if users and users[0].password == data['password']:
         LOG.debug('%s login success.' % users)
         utils.set_session(self.request, users[0].username)
         return utils.render('merchant/home.html', {'welcome': 'Welcome'})
     else:
         LOG.debug('%s login failed.' % users)
         return utils.render('merchant/m_sign_in.html',
                             {'error': 'Username or password is wrong!',
                              'form':form})
开发者ID:zsjss,项目名称:payme,代码行数:12,代码来源:merchantbase.py

示例3: safe

def safe(req):
    usernam = req.session.get('username')
    user = models.User.objects.filter(username=usernam)
    local_time = time.strftime('%Y-%m-%d-%H:%M:%S',
                               time.localtime(time.time()))
    return utils.render('security_certificate.html',
                        {'local_time': local_time,
                         'phone': user[0].phone})
开发者ID:smartbrandnew,项目名称:payme,代码行数:8,代码来源:account.py

示例4: accountmoney

def accountmoney(request):
    merchant = utils.get_merchant_obj(request)
    money = merchant.accountmoney_set.all()
    # totalmoney = models.TotalMoney.objects.filter(owner_id=merchant.id)
    totalmoney = 0.0
    for m in money:
        totalmoney += m.in_out_money
    return utils.render("merchant/accountmoney.html", {"totalmoney": totalmoney, "money": money})
开发者ID:nidongliang,项目名称:payme,代码行数:8,代码来源:merchantaccount.py

示例5: form_valid

 def form_valid(self, form):
     data = form.cleaned_data
     user = models.User(**data)
     user.save()
     content = 'Welcome to zufangbao! You have successed to sign up!'
     sendmessage(self.request, content)
     content = data['username'] + ' registration succeed!'
     utils.send_mail(data['email'], content)
     return utils.render('portal.html', {})
开发者ID:nidongliang,项目名称:payme,代码行数:9,代码来源:base.py

示例6: info

def info(req):
    usernam = req.session.get('username')
    user = models.User.objects.filter(username=usernam)
    return utils.render('personal_info.html',
                        {'username': user[0].username,
                         'phone': user[0].phone,
                         'real_id': user[0].real_id,
                         'real_name': user[0].real_name,
                         'email': user[0].email})
开发者ID:smartbrandnew,项目名称:payme,代码行数:9,代码来源:account.py

示例7: account_payrent_list

def account_payrent_list(request):
    user = utils.get_user_obj(request)

    renters = []
    passive_renters = user.landlordrenterinfo_set.all()
    active_renters = user.renterrentprofile_set.all()

    renters.extend(passive_renters)
    renters.extend(active_renters)
    renters.sort(key=lambda x: x.created_at)
    renters.reverse()
    return utils.render('account/payrentlist.html',
                        {'renters': renters})
    user = utils.get_user_obj(request)

    if user.is_vip == False:
        return vipconfirm(request)
    else:
        return utils.render('account/vip.html', {'message': 'Welcome,VIP!'})
开发者ID:smartbrandnew,项目名称:payme,代码行数:19,代码来源:account.py

示例8: form_valid

 def form_valid(self, form):
     merchant = utils.get_merchant_obj(self.request)
     data = form.cleaned_data
     if merchant and merchant.password == data["oldpassword"] and data["newpassword"] == data["newpassagain"]:
         merchant.password = data["newpassword"]
         merchant.save()
         return merchantaccount(self.request)
     else:
         LOG.debug("%s Change password failed." % merchant)
         return utils.render("merchant/changepassword.html", {"errors": "Password is wrong", "form": form})
开发者ID:nidongliang,项目名称:payme,代码行数:10,代码来源:merchantaccount.py

示例9: form_valid

 def form_valid(self, form):
     merchant = utils.get_merchant_obj(self.request)
     data = form.cleaned_data
     if merchant and merchant.password == data['oldpassword'] and data['newpassword'] == data['newpassagain']:
         merchant.password = data['newpassword']
         merchant.save()
         return merchantaccount(self.request)
     else:
         LOG.debug("%s Change password failed." %merchant )
         return utils.render('merchant/changepassword.html',
                             {'errors': 'Password is wrong',
                              'form': form})
开发者ID:smartbrandnew,项目名称:payme,代码行数:12,代码来源:merchantaccount.py

示例10: form_valid

 def form_valid(self, form):
     data = form.cleaned_data
     users = models.User.objects.filter(username=data['username'])
     if users and users[0].password == data['password']:
         LOG.debug('%s login success.' % users)
         utils.set_session(self.request, users[0].username)
         return portal(self.request)
     else:
         LOG.debug("%s login failed." % users)
         return utils.render('sign_in.html',
                             {'errors': 'Username or password is wrong',
                              'form': form})
开发者ID:Nick280375880,项目名称:payme,代码行数:12,代码来源:base.py

示例11: form_valid

 def form_valid(self, form):
     user = utils.get_user_obj(self.request)
     data = form.cleaned_data
     if user and user.password == data['password'] and \
        data['new_password'] == data['confirm_new_password']:
         user.password = data['new_password']
         user.save()
         return info(self.request)
     else:
     #LOG.debug("%s password modify failed." % user)
         return utils.render('password_modify.html',
                             {'errors': 'password is wrong',
                              'form': form})
开发者ID:smartbrandnew,项目名称:payme,代码行数:13,代码来源:account.py

示例12: form_valid

 def form_valid(self, form):
     user = utils.get_user_obj(self.request)
     data = form.cleaned_data
     if user and data['phone']:
         user.verifycode = random.randrange(0, 999999)
         user.save()
         content = 'verifycode:' + str(user.verifycode)
         utils.send_msg(data['phone'], content)
         return phonemodify(self.request)
     else:
     #LOG.debug("%s phone modify failed." % user)
         return utils.render('send_verifycode.html',
                             {'errors': 'failed',
                              'form': form})
开发者ID:nidongliang,项目名称:payme,代码行数:14,代码来源:account.py

示例13: charge_renter_done

def charge_renter_done(request, rent_id, renter_id):
    renter = get_object_or_404(models.LandlordRenterInfo,
                               pk=renter_id, rent_id=rent_id)
    renter.state = '1'
    renter.save()
    return utils.render('charge/renter_finish.html', {})
开发者ID:nidongliang,项目名称:payme,代码行数:6,代码来源:charge_rent.py

示例14: charge_renter_confirm

def charge_renter_confirm(request, rent_id, renter_id):
    renter = get_object_or_404(models.LandlordRenterInfo,
                               pk=renter_id, rent_id=rent_id)
    return utils.render('charge/renter_confirm.html',
                        {'renter': renter})
开发者ID:nidongliang,项目名称:payme,代码行数:5,代码来源:charge_rent.py

示例15: charge_rent_detail

def charge_rent_detail(request, profile_id):
    rent = get_object_or_404(models.LandlordRentProfile, pk=profile_id)
    return utils.render('charge/detail.html', {'rent': rent})
开发者ID:nidongliang,项目名称:payme,代码行数:3,代码来源:charge_rent.py


注:本文中的portal.views.utils.render函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。