How to filter through objects in python? [closed]

I am receieving an array of items from an API like this:

{
    "items": [
        {
            "id": "1",
            "name": "Item #1",
            "owner": {
                "id": "james",
                "type": "user",
            },
        },
        {
            "id": "2",
            "name": "Item #3",
            "owner": {
                "id": "david",
                "type": "user",
            },
        },
        {
            "id": "3",
            "name": "Item #3",
            "owner": {
                "id": "david",
                "type": "user",
            },
        },
    ],
}

Based off this example, how can I return only the items by owner 'david' in my get function in Views?

Back to Top