Jump to content

Johan Boekhoven

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Johan Boekhoven

  1. 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.

×
×
  • Create New...