0
我正在尝试使用QueryXML和SUDS来查询Autotask。但是,由于缩进错误,我无法使用QueryXML。这是我的代码:将QueryXML与SUDS和Python结合使用
class ConnectATWS():
def __init__(self):
#Connect to server with the credentials
app_config = Init()
self.username = app_config.data["Username"]
self.password = app_config.data["Password"]
self.login_id = app_config.data["LoginID"]
self.url = app_config.data["AutotaskUpdateTicketEstimatedHours_net_autotask_webservices5_ATWS"]
strCurrentID = "0"
strCriteria = "<condition><field>Status<expression op=""NotEqual"">5</expression></field></condition>"
strQuery = "<queryxml><entity>Ticket</entity><query>" & _
"<condition><field>id<expression op=""greaterthan"">" & strCurrentID & "</expression></field></condition>" & strCriteria & _
"<condition><field>EstimatedHours<expression op=""isnull""></expression></field></condition>" & _
"</query></queryxml>"
client = Client(self.url + "?WSDL", username=self.login_id, password=self.password)
response = client.service.query(strQuery)
print response
这是我的错误:
File "/Users/AAAA/Documents/Aptana/AutotaskUpdateTicketEstimatedHours/Main.py", line 35
"<condition><field>id<expression op=""greaterthan"">" & strCurrentID & "</expression></field></condition>" & strCriteria & _
^
IndentationError: unexpected indent
我怎样才能绕过缩进错误和运行查询?
您可以粘贴错误的整个堆栈跟踪吗?你想用“&”和“_”操作符做什么? – georgeofallages