Remus Avram Posted August 24, 2016 Report Share Posted August 24, 2016 Hi all, is it possible to get all the versions of an AssetBuild directly? For example: assetBuild['versions'] or assetbuild.get_versions|() Cheers! Link to comment Share on other sites More sharing options...
Lucas Correia Posted August 25, 2016 Report Share Posted August 25, 2016 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 More sharing options...
Remus Avram Posted August 25, 2016 Author Report Share Posted August 25, 2016 HI Lucas, thanks for your answer! It make sense! Cheers, Remus Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.