Jump to content

'versions' attribute for AssetBuild Type


Remus Avram

Recommended Posts

Hi Remus,

To get all versions, you will first need to go over all Assets.  See the diagram on this article in the documentation for a better understanding.

 

Here is an example where I query for the link attribute on each version for the first asset build which has any assets. The select part of the query can be omitted, but can improve the performance significantly when working with nested relationships.

>>> asset_build = session.query('select assets.versions.link from AssetBuild where assets any()').first()
>>> for asset in asset_build['assets']:
...     for version in asset['versions']:
...             print [item['name'] for item in version['link']]
...
[u'Project', u'My Asset Build', u'check v1']
[u'Project', u'My Asset Build', u'check v2']
[u'Project', u'My Asset Build', u'pattern v1']

 

Regards,
Lucas

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...