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

Retrieve fields inside arrays of entities with sg.find_one() #160

Open
kschiffer opened this issue Nov 20, 2017 · 0 comments
Open

Retrieve fields inside arrays of entities with sg.find_one() #160

kschiffer opened this issue Nov 20, 2017 · 0 comments

Comments

@kschiffer
Copy link

I've been looking to find an answer to this for quite a while but couldn't find anything in the docs…

I try to retrieve a version together with its notes, but I need to have more of the notes than just the standard fields that are retrieved.
Here's the relevant part:

def getVersion(id):
    sg = Shotgun("supplied","supplied","supplied")

    response = sg.find_one("Version", [["id", "is", int(id)]], ['id', 'notes', 'notes.Note.content'])
    
    return response

I thought notes.Note.content would be the right way to do it but since it is a collection, it does not seem to work. The response does not give me the notes content fields but just this:

{
    "notes": [
        {
            "type": "Note",
            "id": 25797,
            "name": "Example User on 008_010_v103 and 008_010 - this is a test"
        }
    ],
    "type": "Version",
    "id": 4068
}

Is there any way to get specified fields of the notes list or do I need to perform another query to get these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant