-
Posts
11 -
Joined
-
Last visited
-
Days Won
3
Reputation Activity
-
Mani Varma got a reaction from Andrew Lawrence in Refresh Widget
Found it in one of the documentation and it worked. I was trying to subscribe to ftrack.widget.update before which didn't work out as expected.
https://help.ftrack.com/en/articles/1040449-custom-widgets
window.addEventListener('message', function (event) { var content = event.data; console.debug('Got ' + content.topic + ' event.', content); if (content.topic === 'ftrack.widget.load') { //Store credentials for later. window.credentials = content.data.credentials; } else if (content.topic === 'ftrack.widget.update') { // Load new data. } }, false);
-
Mani Varma got a reaction from Patrick Boucher ftrack in Refresh Widget
Found it in one of the documentation and it worked. I was trying to subscribe to ftrack.widget.update before which didn't work out as expected.
https://help.ftrack.com/en/articles/1040449-custom-widgets
window.addEventListener('message', function (event) { var content = event.data; console.debug('Got ' + content.topic + ' event.', content); if (content.topic === 'ftrack.widget.load') { //Store credentials for later. window.credentials = content.data.credentials; } else if (content.topic === 'ftrack.widget.update') { // Load new data. } }, false);
-
Mani Varma got a reaction from caebrasil in Note Component's Storage Usage
Hi,
I cooked up a script to delete File Component from Note's belonging to a specific Project and has worked out fine, but it doesn't seem to reflect on Ftrack Storage Usage. Query for NoteComponent doesn't return anything anymore and I don't understand where NoteComponent get it's storage space from if it's not in Ftrack Storage.
def get_filter_string(entity_ids): return ', '.join( '"{0}"'.format(entity_id) for entity_id in entity_ids ) note_entities = [] project_component = session.query('select name, descendants from Project where id is "{0}"'.format( entity_id )).one() note_entities.append(project_component['id']) for hierarchy_item in project_component['descendants']: note_entities.append(hierarchy_item['id']) note_components = session.query('select component, component.file_type, component.name ' 'from NoteComponent where note.parent_id in ({0})'.format( get_filter_string(note_entities) )).all() # Download happens from note_components information then delete. for note_component in note_components: session.delete(note_component['component']) session.commit()
-
Mani Varma reacted to Mattias Lagergren in Removing a component from a Note
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()