thechiclayano
-
Posts
2 -
Joined
-
Last visited
Content Type
Events
Profiles
Forums
Downloads
Posts posted by thechiclayano
-
-
Hi everyone, I'm a new user. I'm working in version 2.3.3 of the ftrack python api.
So i've been able to create tasks with the following code (this similarly applies for all entity types i've tried):
shot = session.query('Shot where name is create_test_shot').one() task = session.create('Task', {'name':'create_test_task'}) shot['children'].append(task) session.commit()
This works. However, a lot of other things I would expect to work don't. Here's a few examples:
shot = session.query('Shot where name is create_test_shot').one() task = session.create('Task', {'name':'create_test_task'}) task['parent'] = shot #This one is straight from the tutorial session.commit()
shot = session.query('Shot where name is create_test_shot').one() task = session.create('Task', {'name':'create_test_task', 'parent':shot}) session.commit()
shot = session.query('Shot where name is create_test_shot').one() task = session.create('Task', {'name':'create_test_task', 'parent_id':shot['id']}) session.commit()
shot = session.query('Shot where name is create_test_shot').one() task = session.create('Task', {'name':'create_test_task'}) shot['children'].append(task) task['type'] = 'animation' session.commit()
All of these fail with the same error when I attempt to commit (using the same data and a fresh session in each case):
Server reported error: ValueError(Cannot set relationship to string value.) Nonetype: None
Any ideas on what i'm doing wrong?
'cannot set relationship to string value' on creation (python api)
in Help
Posted
Hi Patrick.
Thank you, this cleared things up. The first example also started working for me know. It's possible I had an entity from a previously closed session in there. Thanks for your help!