Jump to content

Note Relationship


aazim.mohammad

Recommended Posts

Hi,

There is no `parent` relationship on notes due to a technical limitation and the fact that notes can be written on multiple entity types (such as tasks or versions). You can work around this issue by rephrasing the query to start with tasks and using the notes relationship.

See the example below:

note_content_contains = 'xyz'
task_name = 'something'
tasks = session.query(
    'select notes.content from Task '
    'where notes.content like "%{0}%" and name is "{1}"'.format(
        note_content_contains, task_name
    )
)

for task in tasks:
    for note in task['notes']:
        print note['content']

 

If you want to include notes on other objects, such as Folders or Shots, change `from Task` to `from TypedContext`. TypedContext is the name of a base entity type which can be used to query all objects in a project hierarchy.

Regards,
Lucas

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...