aserjogin Posted March 26, 2018 Report Share Posted March 26, 2018 Hello, I am quite new to the API, which is why I decided to ask for help on the forum. (Sorry, if it is a stupid question...) Is there a way to access the <ftrack_api.collection.Collection object at ...> in order to retrieve something like a pair of component_id and note_id? So I could check whether the attachment is present on a note or not? I am trying to access the object via querying a note with certain content. Here is a short example: some_note = s.query('Note where content is "let there be something written in here"').one() some_note['note_components'] - results in me getting an object. Is there a way to get more out of it? I am sure there is, but I have no idea. Thank you in advance! Best Regards, Anton. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted March 27, 2018 Report Share Posted March 27, 2018 Hi and welcome to the forum. The Collection object that you get can be accessed much like a list: for note_component in some_note['note_components']: ... some_note['note_components'][0] et.c Link to comment Share on other sites More sharing options...
aserjogin Posted March 27, 2018 Author Report Share Posted March 27, 2018 7 hours ago, Mattias Lagergren said: Hi and welcome to the forum. The Collection object that you get can be accessed much like a list: for note_component in some_note['note_components']: ... some_note['note_components'][0] et.c Thanks for the welcome Now I get it... either I receive NoteComponents or NoneType objects (if there are no attachments). Should have been more attentive. I appreciate for taking your time and helping me out, thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.