Hello evryone,
Here is my first post.
I am wondering if it’s possible to list all asset presents in the field “assets” in shot context, filtered by there asset status?
ex of the basic idea:
filters = [
[“id”, “is”, shot[“id”]],
[‘sg_status_list’, ‘is_not’, ‘omt’]
]
fields = [‘assets’]
data = sg.find_one(‘Asset’, filters= filters, fields= fields)
Not sure to be clear,
Thanks a lot
Mathieu
Your code is correct. What is your question?
Edit: if you want to filter all assets linked to the current one, and with their status as omt, then maybe try this
sg.find_one("Asset", [["assets.Asset.sg_status_list", "is_not", "omt"]])
My code looks correct but is not I will try your way,
Thanks for your help.
Best regards
Mathieu
Ok I took a look on my code, I made a mistake on my first theard.
Here is the code where I want to query a shot sg_fields. I that case it the field “assets”, in order to list asset parented to my shot. But In same time I want to query only assets not omitted.
filters = [
[“id”, “is”, ctx.entity[“id”]],
[“assets.Asset.sg_status_list”, “is_not”, “omt”]
]
fields = ['assets']
data = sg.find_one('Shot', filters= filters, fields= fields)
No I can’t filter by asset from shot
the only way I found is to list all my assets and then get there status with two sg.find_one() …