Jump to content

Remove existing asset


Vlad Skrypnyk

Recommended Posts

  • 2 weeks later...

Here's my cleanup routine for assets that have no AssetVersion:

 

def delete_empty_assets():
    """Delete all assets that have no versions."""

    assets = SESSION.query("select id, name from Asset where latest_version is none").all()

    for asset in assets:
        print(f"found asset: {asset['id']} : {asset['name']}")
        SESSION.delete(asset)
    SESSION.commit()

SESSION is an instance of FtrackSession.

Link to comment
Share on other sites

  • 2 weeks later...

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
×
×
  • Create New...