本文整理汇总了Python中models.order.Order.fetch方法的典型用法代码示例。如果您正苦于以下问题:Python Order.fetch方法的具体用法?Python Order.fetch怎么用?Python Order.fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.order.Order
的用法示例。
在下文中一共展示了Order.fetch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import fetch [as 别名]
def get(self):
tCode = re.sub(r"\W", "", self.request.get("code")).lower()
tOrderId = self.request.get("id")
logging.debug(tCode)
tOrder = Order()
# tOrder.orderVerificationCode
tOrderQuery = Order().all()
tOrderQuery.filter("orderVerificationCode", tCode)
if tOrderId:
tOrderQuery.filter("orderTransactionId", tOrderId)
tOrderList = tOrderQuery.fetch(limit=1)
logging.debug(str(tOrderList))
tSave = False
if tOrderList is not None:
try:
tOrder = tOrderList[0]
tOrder.orderIsVerified = True
tSave = True
except:
if len(tOrderList) > 0:
tOrder = tOrderList
tOrder.orderIsVerified = True
tSave = True
if tSave:
try:
tOrder.put()
except:
pass
示例2: GetContext
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import fetch [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
示例3: post
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import fetch [as 别名]
def post(self):
tIpLookup = IpLookup()
tIpStore = IpInfo()
tIp = str(self.request.get('ip'))
tTransactionId = str(self.request.get('transid'))
tIpInfo = {}
#logging.debug("Scraping Ip: " + tIp)
if (tIp != None and len(tIp) > 0):
tIpInfo = tIpLookup.IpInfoScraper(tIp)
else:
tIpInfo = {}
tIpInfo['country'] = ""
tIpInfo['host'] = ""
tIpInfo['state'] = ""
tIpInfo['isp'] = ""
tIpInfo['proxy'] = ""
tIpInfo['type'] = ""
tIpStore.ip = tIp
tIpStore.ipCountry = tIpInfo['country']
tIpStore.ipHost = tIpInfo['host']
tIpStore.ipState = tIpInfo['state']
tIpStore.ipIsp = tIpInfo['isp']
tIpStore.ipProxy = tIpInfo['proxy']
tIpStore.ipType = tIpInfo['type']
tIpStore.ipOrder = tTransactionId
tIpKey = tIpStore.put()
#logging.debug("Stored IP: " + tIp + " at Key " + str(tIpKey))
tOrder = Order()
tOrderQuery = Order().all()
#logging.debug("Transaction Id: " + tTransactionId)
tOrderQuery.filter("orderTransactionId", tTransactionId)
tOrder = tOrderQuery.fetch(1)[0]
tMobilePhone = tOrder.orderMobileNumber
tCustomerKey = tOrder.orderCustomer
tOrderKey = str(tOrder.key())
#logging.debug("IP Address Mobile Number " + str(tMobilePhone))
if (tMobilePhone != None and len(tMobilePhone) > 0):
taskqueue.add(url="/phonelookup", countdown = 1, params = { "order": tOrderKey,
"customer": tCustomerKey,
"ipcountry": tIpStore.ipCountry } )
示例4: PostContext
# 需要导入模块: from models.order import Order [as 别名]
# 或者: from models.order.Order import fetch [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