Jump to content

Query ' where ... is ...' not case sensitive


Remus Avram

Recommended Posts

Hi all,

I have 2 assets in Ftrack: 'asset_name' and 'ASSET_NAME'.

When I query via the API both assets, all the time I get only the first one because the name is not case sensitive.

Example:

assets = session.query("Asset where name is 'asset_name'").all()
print len(assets)
print assets[0]['name']
print assets[0]['id']

# Return:

1
asset_name
4c63aa70-6475-11e6-b6fd-005056a76761

 

assets = session.query("Asset where name is 'ASSET_NAME'").all()
print len(assets)
print assets[0]['name']
print assets[0]['id']

# Return:

1
asset_name
4c63aa70-6475-11e6-b6fd-005056a76761

 

Ftrack server: v3.3.30

API: v0.15.5

Link to comment
Share on other sites

  • 2 weeks later...

Looks like I missed an important detail in your first question. You should be getting all items that matched the query, both the object named ASSET_NAME and the one named asset_name.

I've tried to reproduce the behaviour by creating two objects with the same name and querying for them, and do get both results. Are you sure that you have a `ASSET_NAME` object?

>>> items = session.query('AssetBuild where name is "ASSET_NAME"').all()
>>> len(items)
2

 

Link to comment
Share on other sites

Hi Lucas,

thanks for checking it!

You are right! It's getting all the items that matched the query.

What actually happened, we published an asset via the API, and a new asset with the same name (case insensitive) via the ftrack-connect.

The one published via the API get automatically renamed from 'asset_name' to 'asset_name_'.

If we try to publish a new asset with the same name via de ftrack-connect we get an error that the asset exists.

In my case I didn't check if the asset has the same name anymore.

We will do more tests to be sure that we didn't do something wrong.

Cheers!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...