本文整理汇总了Python中auth.Auth.select方法的典型用法代码示例。如果您正苦于以下问题:Python Auth.select方法的具体用法?Python Auth.select怎么用?Python Auth.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth.Auth
的用法示例。
在下文中一共展示了Auth.select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: info
# 需要导入模块: from auth import Auth [as 别名]
# 或者: from auth.Auth import select [as 别名]
def info(inData):
from auth import Auth
pureData=Sensor.select(inData)
stationInfo={}
authInfo={}
userInfo={}
stationQuery=session.query(Station)
authQuery=session.query(Auth)
userQuery=session.query(User)
for tmp in pureData['data']:
t=tmp['stationId']
tmpAllStation=Station.select({'id': int(t)})
if(len(tmpAllStation['data'])==0):
tmp['stationName']='not find'
else:
tmp['stationName']=tmpAllStation['data'][0]['name']
tmpAllAuth=Auth.select({'sensorId': int(tmp['id'])})
if(len(tmpAllAuth['data'])==0):
tmp['username']='not find'
tmp['userId']=-1
else:
tmpAllUser=User.select({'id': int(tmpAllAuth['data'][0]['userId'])})
if(len(tmpAllUser['data'])==0):
tmp['username']='not find'
tmp['userId']=-1
else:
tmp['username']=tmpAllUser['data'][0]['username']
tmp['userId']=tmpAllUser['data'][0]['id']
return pureData
示例2: info
# 需要导入模块: from auth import Auth [as 别名]
# 或者: from auth.Auth import select [as 别名]
def info(inData):
from user import User
from sensor import Sensor
from station import Station
from auth import Auth
allEqpData=Eqp.select(inData)
userInfo={}
sensorInfo={}
stationInfo={}
authInfo={}
#print(allEqpData)
for tmp in allEqpData['data']:
t=tmp['number']
tmpAllSensor=Sensor.select({'number': t})
if(len(tmpAllSensor['data'])==0):
tmp['sensorName']='not find'
tmp['stationName']='not find'
tmp['username']='not find'
else:
curSensor=tmpAllSensor['pureData'][0]
tmp['sensorName']=curSensor.name
tmpAllStation=Station.select({'id': curSensor.stationId})
if(len(tmpAllStation['data'])==0):
tmp['stationName']='not find'
else:
curStation=tmpAllStation['pureData'][0]
tmp['stationName']=curStation.name
tmp['userName']=curStation.supervisor
tmpAllAuth=Auth.select({'sensorId': curSensor.id})
# if(len(tmpAllAuth['data'])==0):
# tmp['username']='not find'
# else:
# tmpAllUser=User.select({'id': tmpAllAuth['pureData'][0].userId})
# if(len(tmpAllUser['data'])==0):
# tmp['username']='not find'
# else:
# tmp['username']=tmpAllUser['data'][0]['username']
return allEqpData