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


Python Order.orderQuantity方法代码示例

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


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

示例1: GetContext

# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import orderQuantity [as 别名]
    def GetContext(self):
        tContext = {}
        tPaypal = PaypalOrder()
        tOrderList = []

        tOrderAmounts = [1000000, 2000000, 5000000, 10000000, 20000000, 40000000, 80000000, 100000000]

        i = 1
        while i < 21:
            i = i + 1
            tOrder = Order()
            tOrder.orderQuantity = choice(tOrderAmounts)
            tAgentId = tPaypal.GetAssignedAgent(tOrder)
            tOrder.orderAgent = tAgentId
            tOrderList.append(tOrder)

        tContext["orders"] = tOrderList

        return tContext
开发者ID:Kenneth-Posey,项目名称:kens-old-projects,代码行数:21,代码来源:paypal.py

示例2: ProcessOrder

# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import orderQuantity [as 别名]

#.........这里部分代码省略.........

            tPayloadEncoded = tOrderHandler.GeneratePayload(tPaypalPayload)
            request_cookies = mechanize.CookieJar()
            request_opener = mechanize.build_opener(mechanize.HTTPCookieProcessor(request_cookies))
            request_opener.addheaders = [("Content-Type", "application/x-www-form-urlencoded")]
            mechanize.install_opener(request_opener)
            tResponse = mechanize.urlopen(url=tUrl, timeout=25.0, data=tPayloadEncoded)
            tResult = str(urllib.unquote(tResponse.read()))
            tResultSplit = tResult.split("&")

            for tPair in tResultSplit:
                tSplitPair = tPair.split("=")
                if len(tSplitPair) == 1:
                    tSplitPair.append("")
                tResultDictionary[tSplitPair[0]] = tSplitPair[1]
                logging.debug(tSplitPair[0] + "    " + tSplitPair[1])
            tGoldAmountString = tResultDictionary["L_NAME0"]
            logging.debug("Gold amount string %s".format(tGoldAmountString))
            try:
                tGoldRegex = re.compile("([0-9]*?[m|M]).T")
                tGoldMatch = tGoldRegex.findall(tGoldAmountString)
                # logging.debug("Backup gold amount parser hit, string " + tGoldAmountString + "   Match: " + tGoldMatch[0])
                tGoldAmount = tGoldMatch[0]
            except:
                tGoldRegex = re.compile("([0-9]*?[m|M]).T")
                tGoldMatch = tGoldRegex.findall(tGoldAmountString)
                try:
                    # logging.debug("Backup gold amount parser hit, string " + tGoldAmountString + "   Match: " + tGoldMatch[0])
                    tGoldAmount = tGoldMatch[0]
                except:
                    # logging.debug("No gold match")
                    tGoldAmount = ""

        tOrder.orderQuantity = NumberToGp.ConvertBetToInt(tGoldAmount)
        tOrder.orderSimpleGoldAmount = tGoldAmount
        tOrder.orderFormEmail = tEmail
        tOrder.orderAccountName = tRsName
        tOrder.orderMobileNumber = tMobilePhone
        tOrder.orderPromotionalCode = tPromotionCode.lower()
        tOrder.orderIp = tOrderIp
        if tMembers == "yes":
            tOrder.orderCustomerIsMember = True
        else:
            tOrder.orderCustomerIsMember = False

        # Paypal Info
        tOrder.orderTransactionId = tTransactionId

        tOrder.orderPaypalFirstName = tCustomerFirstName
        tOrder.orderPaypalLastName = tCustomerLastName

        tOrder.orderCost = float(tArgumentDic["payment_gross"])
        tOrder.orderCustomerPaypalId = tArgumentDic["payer_id"]
        tOrder.orderPaypalEmail = str(tPaypalEmail).lower()

        tAssignedAgentNick = tPaypalOrder.GetAssignedAgent(tOrder)
        tOrder.orderAssignedAgent = tAssignedAgentNick
        # logging.debug("Order assigned to agent: " + str(tAssignedAgentNick))

        tOrder.orderReferralCode = tReferCode

        tOrder.orderDeliver = "False"

        if tOrder.orderVerificationCode == None or tOrder.orderVerificationCode == "":
            tOrder.orderVerificationCode = re.sub(r"\W", "", str(uuid.uuid4())).lower()
开发者ID:Kenneth-Posey,项目名称:kens-old-projects,代码行数:69,代码来源:paypal.py


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