当前位置: 首页>>代码示例>>Python>>正文


Python Order.key方法代码示例

本文整理汇总了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 } )
开发者ID:Kenneth-Posey,项目名称:kens-old-projects,代码行数:48,代码来源:iplookup.py


注:本文中的models.order.Order.key方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。