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


Python Page.view方法代码示例

本文整理汇总了Python中pages.Page.view方法的典型用法代码示例。如果您正苦于以下问题:Python Page.view方法的具体用法?Python Page.view怎么用?Python Page.view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pages.Page的用法示例。


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

示例1: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import view [as 别名]
    def get(self):
        #Membership Data Information
        #Charles Registration
        c = Registration()
        c.name = "Charles"
        c.address = "124 Main Street, Chambersburg, PA 17201"
        c.phone = "717-555-9545"
        c.level = "Professional"
        c.horses = 5
        c.fee = 125.95
        c.calc_price()
        #self.response.write ("<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price))

        #Megan Registration
        m = Registration()
        m.name = "Megan"
        m.address = "567 Second Street, Chambersburg, PA 17201"
        m.phone = "717-555-9545"
        m.level = "Youth"
        m.horses = 15
        m.fee = 25.95
        m.calc_price()
        #self.response.write ("<br><br><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price))

        #Duke Registration
        d = Registration()
        d.name = "Duke"
        d.address = "2905 Roland Avenue, Chambersburg, PA 17201"
        d.phone = "555-234-6789"
        d.level = "Amatuer"
        d.horses = 1
        d.fee = 75.95
        d.calc_price()
        #self.response.write ("<br><br><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + d.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price))

        #Jenn Registration
        j = Registration()
        j.name = "Jennifer"
        j.address = "9012 Norland Avenue, Chambersburg, PA 17201"
        j.phone = "555-573-9753"
        j.level = "Youth"
        j.horses = 5
        j.fee = 25.95
        j.calc_price()
        #self.response.write ("<br><br><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price))

        #Tara's Registration
        t = Registration()
        t.name = "Tara"
        t.address = "1242 Livermoore Road, Chambersburg, PA 17201"
        t.phone = "555-234-9874"
        t.level = "Professional"
        t.horses = 15
        t.fee = 125.95
        t.calc_price()
        #self.response.write ("<br><br><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price))

        p = Page()
        #p.body = "<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price) + "<br/><hr><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price) + "<br/><hr><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price) + "<br/><hr><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price) + "<br/><hr><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price)
        p.body = "<h1>Registered Members</h1><a href='?name="+ c.name +"'>" + c.name + "</a><br>" + "<a href='?name="+ m.name +"'>" + m.name + "</a><br>" + "<a href='?name="+ d.name +"'>" + d.name + "</a><br>" + "<a href='?name="+ j.name +"'>" + j.name + "</a><br>" + "<a href='?name="+ t.name +"'>" + t.name + "</a><br>"

        # When link is click and there is variables this following is viewed
        if self.request.GET:
            name = self.request.GET['name']

            # if variable = Charles
            if name == "Charles":
                address = c.address
                phone = c.phone
                level = c.level
                horses = c.horses
                fee = c.fee
                _final_price = m.calc_price()
                p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price)

            # if variable = Megan
            if name == "Megan":
                address = m.address
                phone = m.phone
                level = m.level
                horses = m.horses
                fee = m.fee
                _final_price = m.calc_price()
                p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price)

            # if variable = Duke
            if name == "Duke":
                address = d.address
                phone = d.phone
                level = d.level
                horses = d.horses
                fee = d.fee
                _final_price = d.calc_price()
                p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price)

            # if variable = Jennifer
            if name == "Jennifer":
                address = j.address
                phone = j.phone
                level = j.level
#.........这里部分代码省略.........
开发者ID:tthorne,项目名称:dpwp,代码行数:103,代码来源:main.py


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