本文整理匯總了Python中models.order.Order.key方法的典型用法代碼示例。如果您正苦於以下問題:Python Order.key方法的具體用法?Python Order.key怎麽用?Python Order.key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.order.Order
的用法示例。
在下文中一共展示了Order.key方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: post
# 需要導入模塊: from models.order import Order [as 別名]
# 或者: from models.order.Order import key [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 } )