本文整理匯總了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