Jump to content

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


Remus Avram

Recommended Posts

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

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...