Jump to content

thechiclayano

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by thechiclayano

  1. 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?

×
×
  • Create New...