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

inventory-list-items nested into inventory-lists #49

Open
Samuel29 opened this issue Mar 29, 2021 · 3 comments
Open

inventory-list-items nested into inventory-lists #49

Samuel29 opened this issue Mar 29, 2021 · 3 comments

Comments

@Samuel29
Copy link

Samuel29 commented Mar 29, 2021

Hi. I've just forked the repository to add some missing services, but I'm not familiar with Thingy.
I'm especially interested in implementing the inventory-list and its nested inventory-list-items (cf doc here and there)
so far, I've added the support for InventoryList. But I'm not sure about the way to fetch its children objects.

GET/POST /inventory-list/<ID>/item interacts with the list of items
GET/POST /inventory-list/<ID>/item/<ITEM-ID> interacts with a single item

Could you provide some guidance?

@ramnes
Copy link
Contributor

ramnes commented Mar 29, 2021

Hey there, glad to see someone from AppNexus playing with this project. :)

What's the Python API you'd expect? Something in these lines?

inventory_list = InventoryList.find_one()
print(inventory_list.items[0])

If so, you'd just have to add an InventoryList(Model) class inside models.py that defines an items property.

@Samuel29
Copy link
Author

Hello. Thanks for pointing that out, I'm realizing that my profile was outdated. I'm a former Appnexus folk. now I'm using the platform as a client :-)

Your proposal seems so obvious... I've been trying more complex changes lol. I'll give it a shot.
Thanks for your prompt answer!

@rambobinator
Copy link
Collaborator

Hi,

Ramnes's snippet work but it's a read only solution, and maybe you'd like to query Items by Id and not getting the full inventory ?

We had the same issue with campaigns being now ALI/split, you should have a look on it:
#36

Also are inventory's item ids unique or are they just list indexes ?

Do not hesitate to PR changes you made.

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

3 participants