Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking inputs/outputs not reflected in local attribute #42

Open
rkoschmitzky opened this issue Jun 29, 2023 · 1 comment
Open

linking inputs/outputs not reflected in local attribute #42

rkoschmitzky opened this issue Jun 29, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@rkoschmitzky
Copy link
Contributor

rkoschmitzky commented Jun 29, 2023

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.

@rkoschmitzky rkoschmitzky added the bug Something isn't working label Jun 29, 2023
@rkoschmitzky rkoschmitzky added this to the v0.1.0rc5 milestone Jun 29, 2023
@rkoschmitzky
Copy link
Contributor Author

rkoschmitzky commented Jun 29, 2023

image
Fixing this seems to be more complicated than expected. Even if add the newly created links it doesn't hold the proper "from" value at this point.

Can be tried with 6a1ab8e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant