• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.render函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: merchantconfirm

def merchantconfirm(request):
    merchant = utils.get_merchant_obj(request)
    confirm = models.MerchantConfirm.objects.filter(owner_id=merchant.id)[0]
    return utils.render("merchant/accountconfirm.html", {"confirm": confirm})
开发者ID:nidongliang,项目名称:payme,代码行数:4,代码来源:merchantaccount.py


示例17: merchantaccount

def merchantaccount(request):
    merchant = utils.get_merchant_obj(request)
    return utils.render(
        "merchant/accountmanage.html",
        {"username": merchant.username, "real_name": merchant.real_name, "phone": merchant.phone},
    )
开发者ID:nidongliang,项目名称:payme,代码行数:6,代码来源:merchantaccount.py


示例18: housemanage

def housemanage(request):
    merchant = utils.get_merchant_obj(request)
    # merchant_id = merchant.id
    # house = models.House.objects.filter(owner_id=merchant_id)
    house = merchant.house_set.all()
    return utils.render("merchant/house.html", {"house": house})
开发者ID:nidongliang,项目名称:payme,代码行数:6,代码来源:merchantaccount.py


示例19: merchanthome

def merchanthome(request):
    return utils.render("merchant/home.html", {"welcome": "Welcome"})
开发者ID:nidongliang,项目名称:payme,代码行数:2,代码来源:merchantaccount.py


示例20: merchantmessage

def merchantmessage(request):
    merchant = utils.get_merchant_obj(request)
    message = merchant.merhantmessage_set.all()
    return utils.render("merchant/merchantmessage.html", {"message": message})
开发者ID:nidongliang,项目名称:payme,代码行数:4,代码来源:merchantaccount.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python portalocker.lock函数代码示例发布时间:2022-05-25
下一篇:
Python home_page.HomePage类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap