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

unable to set attribute if attribute is relationship shortcut #17

Closed
rkoschmitzky opened this issue Jun 20, 2023 · 0 comments · Fixed by #22
Closed

unable to set attribute if attribute is relationship shortcut #17

rkoschmitzky opened this issue Jun 20, 2023 · 0 comments · Fixed by #22
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rkoschmitzky
Copy link
Contributor

rkoschmitzky commented Jun 20, 2023

Problem Statement

Setting attributes won't work if the attribute is a relationship shortcut. This results in a KeyError.

Expected Behavior

This code will work and the task will be set accordingly

from trackteroid import (
    AssetVersion,
    Task,
    Query
)

av_collection = Query(AssetVersion).get_first(projections=[Task])
task_collection = Query(Task).get_first()

av_collection.Task = task_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
  • Ftrack Python API version: 2.5.0
  • Ftrack Server version: unrelated

Reproducible Steps

See expected behavior.

Workaround

Use the full relationship attribute access.

@rkoschmitzky rkoschmitzky added the bug Something isn't working label Jun 20, 2023
@rkoschmitzky rkoschmitzky self-assigned this Jun 20, 2023
@rkoschmitzky rkoschmitzky changed the title unable to set attribute if attribute is abbreviated relationship unable to set attribute if attribute is relationship shortcut Jun 20, 2023
rkoschmitzky added a commit that referenced this issue Jun 22, 2023
@rkoschmitzky rkoschmitzky added this to the v0.1.0rc3 milestone Jun 23, 2023
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

Successfully merging a pull request may close this issue.

1 participant