asset['versions'] doesn't include the new created version in the same session
2 2

3 posts in this topic

If I create a new version and then I query the asset again, then the new version is not included in the asset['versions'].

Example:

asset = session.query("Asset where versions.task.id is '{0}'".format(task['id'])).one()
print len(asset['version'])

session.create('AssetVersion',
               {'asset': asset,
                'task': task,
                'version': 13,
                'status': status,
                }
               )
session.commit()

asset = session.query("Asset where versions.task.id is '{0}'".format(task['id'])).one()
print len(asset['version'])

-------
Returns
2
2

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2