本文整理汇总了Python中models.order.Order.order方法的典型用法代码示例。如果您正苦于以下问题:Python Order.order方法的具体用法?Python Order.order怎么用?Python Order.order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.order.Order
的用法示例。
在下文中一共展示了Order.order方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetContext
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import order [as 别名]
def GetContext(self):
tOrder = {}
tContext = {}
tOrderQuery = Order().all()
tOrderQuery.filter("orderIsGenerated", True)
tOrderQuery.order("-orderCreated")
tOrderList = tOrderQuery.fetch(limit=30)
tContext['orders'] = tOrderList
return tContext
示例2: PostContext
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import order [as 别名]
#.........这里部分代码省略.........
#logging.debug(str(tOrder))
tAvailableEligibility = ["Ineligible","Partially Eligible - INR Only","Eligible"]
tOrder['protection_eligibility'] = random.choice(tAvailableEligibility)
tAvailableStatus = ["verified","unverified"]
tOrder['payer_status'] = random.choice(tAvailableStatus)
if(tType == "random" or tType == "me"):
tOrder['mc_gross'] = tRandomPrice
tOrder['payment_gross'] = tRandomPrice
tOrder['txn_type'] = 'web_accept'
tOrder['discount'] = '0.0'
tOrder['handling_amount'] = '0.0'
tOrder['insurance_amount'] = '0.0'
tOrder['item_number'] = '1'
tOrder['mc_fee'] = '0.0'
tOrder['COUNTRYCODE'] = 'US'
tOrder['address_country'] = 'United States'
tOrder['payment_fee'] = '0.0'
tOrder['quantity'] = "1"
tOrder['shipping'] = "0.0"
tOrder['shipping_discount'] = "0.0"
tOrder['shipping_method'] = "Default"
tOrder['tax'] = "0.0"
tOrder['item_name'] = tRandomAmount.upper() + "Transfer Code"
tReferralCodes = ["", "69a8e184"]
tRandomReferral = random.choice(tReferralCodes)
tPromoCodes = ["SMELITE10"]
tRandomPromoCode = random.choice(tPromoCodes)
tOrder['option_name1'] = 'Test Order Name' #name
tOrder['option_name4'] = 'RS Test Name' #rs name
tOrder['option_name5'] = tRandomReferral #referral
tOrder['option_name5'] = tRandomPromoCode #promocode formerly option 6
tOrder['option_name7'] = tRandomAmount #gold amount
#logging.debug(str(tOrder))
if(tType == "random" or tType == "viprandom"):
tRandomEmail = 'sm-test-email-' + "".join(tRandomNumberList) + "@smokinmils.com"
tOrder['payer_email'] = tRandomEmail
tOrder['payer_id'] = "".join(tRandomNumberList) + "-testid"
tOrder['txn_id'] = "".join(tRandomNumberList)
tOrder['custom'] = '65.91.31.0'
tOrder['option_name2'] = tRandomEmail #email
tOrder['option_name3'] = '310-274-7777' #number
tOrder['transaction_subject'] = '65.91.31.0'
#logging.debug(str(tOrder))
if(tType == "me" or tType == "vipme"):
tOrder['custom'] = '75.138.80.254'
tOrder['payer_email'] = '[email protected]'
tOrder['payer_id'] = 'FE6TJMYCTZ9CA'
tOrder['txn_id'] = "".join(tRandomNumberList)
tOrder['option_name2'] = '[email protected]'
tOrder['option_name3'] = '678-499-6457'
tOrder['transaction_subject'] = '75.138.80.254'
#logging.debug(str(tOrder))
if(tType == "viprandom" or tType == "vipme"):
tOrder['payment_gross'] = "8.99"
tOrder['transaction_subject'] = "VIP Membership"
tOrder['item_name'] = "VIP Membership"
tOrder['item_number'] = "VIP"
tOrder['mc_gross'] = "8.99"
tOrder['txn_type'] = "subscr_payment"
tOrder['subscr_id'] = "".join(tRandomNumberList)
#logging.debug(str(tOrder))
tOrder['payment_status'] = 'Completed'
tOrder['payment_type'] = 'Instant'
tOrder['last_name'] = "Pleco"
tOrder['first_name'] = "Kort"
tOrder['fake'] = 'True'
#logging.debug("Last call: " + str(tOrder))
tPayloadEncoded = urllib.urlencode(tOrder)
#logging.debug("Encoded: " + str(tPayloadEncoded))
tUrl = "http://smokin-goldshop.appspot.com/paypalipn"
#logging.debug("Url: " + str(tUrl))
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)
tOrderQuery = Order().all()
tOrderQuery.filter("orderIsGenerated", True)
tOrderQuery.order("-orderCreated")
tOrderList = tOrderQuery.fetch(limit=30)
tContext['orders'] = tOrderList
#logging.debug("Response: " + str(tResponse))
return tContext