Skip to content

linking inputs/outputs not reflected in local attribute #42

@rkoschmitzky

Description

@rkoschmitzky

Problem Statement

While linking properly creates Link objects and committing to the database works fine the changes aren't reflected on the local attributes incoming_links, and outgoing_links.

Expected Behavior

Extending and removing links should be reflected in the beforementioned attributes on the collection.

Context

Provide any relevant background information or context that may help in understanding the issue.

  • OS: Any
  • Python version: Any 3.x
  • Trackteroid version: main/v0.1.0rc3
  • Ftrack Python API version: 2.5.0
  • Ftrack Server version: -

Reproducible Steps

from trackteroid import (
    Query,
    AssetBuild,
    SESSION
)

assetbuild_collection = Query(AssetBuild).get_all(
    limit=3,
    projections=[
        "name",
        "incoming_links.from",
        "incoming_links.from.name",
        "outgoing_links.to",
        "outgoing_links.to.name"
    ]
)
print(f"Link to add: {assetbuild_collection[0].name}")
print(f"Currently linked: {getattr(assetbuild_collection[1].incoming_links, 'from').name}")
print(f"Local attribute holds: {getattr(assetbuild_collection[1].link_inputs(assetbuild_collection[0]).incoming_links, 'from').name}")

Workaround

Retrieving the newly created link objects can be done by committing the changes first and querying again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions