peter divers

  • Content Count

  • Joined

  • Last visited

About peter divers

  • Rank

Contact Methods

  • Skype

Profile Information

  • Gender
  • Location
    Melbourne, Australia
  1. Hello im passing in a spreadsheet into python trying to create many asset builds and folder etc. from this and i keep getting the below error which i believe is because i have multiple objects in the same hierarchy so its trying to create the upper objects int he hierarchy twice, what is the best way you guys have found to catch this or query if that item exists before creating my code it similar to below below ERROR ftrack_api.exception.ServerError: Server reported error: IntegrityError((_mysql_exceptions.IntegrityError) (1062, "Duplicate entry '780a712a-9bc3-11ea-b9ae-d61ccb4e321b-Assets' for key 'context_parent_id_key'") [SQL: u'INSERT INTO context (context_type, name, parent_id, id) VALUES (%s, %s, %s, %s)'] [parameters: (('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'2fec278a-12d1-44fa-8e26-adc3b218a6bf'), ('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'72fd181f-f72d-4f87-9cd8-74e579cfa588'), ('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'9261c102-080b-45c6-9a07-d3e4eeca3fc1'))] (Background on this error at: [Finished in 21.9s] CODE: task = FTrack_session.create(object_type,{'name':object_name,'parent':FTrack_object_parent})
  2. peter divers


    Ive posted a topic on this but just found this one, so I guess bumping this back up again
  3. peter divers


    Im trying to find where I can return a list of the managers of a project from it seemed easy in the old api of using project.getManager(), but in the new version im having issues ive tried scanning through at both a task and project level to no success any help would be greatly appreciated. cheers
  4. thankyou Mattias, I am now steam rolling through this thanks to your help
  5. Hello all I have an awful lot of questions here as this is my first ftrack api script with event listeners. So here goes below is what I currently have and is all working fine import ftrack_api as ft def ftrackListener(event): print 'event: ' + str(event) for entity in event['data'].get('entities',[]): if entity.get('entityType') == 'task' and entity['action'] == 'update': entityId = str(entity.get('entityId')) parentId = str(entity.get('parentId')) actionType = str(entity['action']) entityType = str(entity.get('entityType')) print 'entity: ' + str(entity) print 'entityType: ' + entityType print 'entityID: ' + entityId print 'parentID: ' + parentId print 'Action Type: ' + actionType session = ft.Session(server_url='https://*******', api_key='*********#######-0a580a5c1009',api_user='dev') session.event_hub.subscribe('topic=ftrack.update',ftrackListener) session.event_hub.wait(duration=50) question one) entityId returns the entityId yet I can for the life of me figure out how to simply find the name of this task or is the entityId the status ? question two) What I am wanting to do is then change the status of the parent of this task which is a shot, Ive seen a lot of posts around but im getting rather confused as to the new and old Api? question three) Lastly status Id,s what is the usual way people are going about finding the actual value or name of this as my current way would be to make a dictionary out of it in a rather manual process, I know their is quite a lot here and any hints on any of it would be fantastic regards Pete