mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
modified query so it's possible to use in python 3 and 2 both
This commit is contained in:
parent
c40fa2fc2b
commit
69b8bd0546
1 changed files with 21 additions and 10 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
|
||||
import sys
|
||||
import pyblish.api
|
||||
import clique
|
||||
|
||||
|
|
@ -26,15 +26,26 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin):
|
|||
str: String query to use with "session.query"
|
||||
"""
|
||||
queries = []
|
||||
for key, value in data.iteritems():
|
||||
if not isinstance(value, (basestring, int)):
|
||||
self.log.info(value)
|
||||
if "id" in value.keys():
|
||||
queries.append(
|
||||
"{0}.id is \"{1}\"".format(key, value["id"])
|
||||
)
|
||||
else:
|
||||
queries.append("{0} is \"{1}\"".format(key, value))
|
||||
if sys.version_info[0] < 3:
|
||||
for key, value in data.iteritems():
|
||||
if not isinstance(value, (basestring, int)):
|
||||
self.log.info(value)
|
||||
if "id" in value.keys():
|
||||
queries.append(
|
||||
"{0}.id is \"{1}\"".format(key, value["id"])
|
||||
)
|
||||
else:
|
||||
queries.append("{0} is \"{1}\"".format(key, value))
|
||||
else:
|
||||
for key, value in data.items():
|
||||
if not isinstance(value, (str, int)):
|
||||
self.log.info(value)
|
||||
if "id" in value.keys():
|
||||
queries.append(
|
||||
"{0}.id is \"{1}\"".format(key, value["id"])
|
||||
)
|
||||
else:
|
||||
queries.append("{0} is \"{1}\"".format(key, value))
|
||||
|
||||
query = (
|
||||
"select id from " + entitytype + " where " + " and ".join(queries)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue