本文整理汇总了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 } )