mitch.s Posted October 29, 2018 Report Share Posted October 29, 2018 Removing a 'Note_Component' Removing the component itself works fine. I query the component by id to get the existing_component ; server_location = session.query('Location where name is "ftrack.server"').one() existing_component = session.query('Component where id is {0}'.format(COMPONENT_ID)).one() server_location.remove_component(existing_component) session.commit() #must close after remove ! session.close() but it seems like some data still remains in the Note_Component (a Note_Component without a Component ?) Do I need to clean this up by hand or is there a more straightforward method? If by hand, how? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted November 1, 2018 Report Share Posted November 1, 2018 Hi, With the code you have there you are only removing the component file from the server location. Instead, try to remove the component itself: session.delete(component) session.commit() Mani Varma and Mohammadreza Hashemizadeh 2 Link to comment Share on other sites More sharing options...
Ethan Posted January 13, 2022 Report Share Posted January 13, 2022 Hey Mattias, What happens with the components that are removed? Does the database just stop tracking them? Is there a way to purge files that have been removed, but not deleted? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now