inventree / inventree-python

Python library for communication with inventree via API
https://docs.inventree.org/en/latest/api/python/python/
MIT License
26 stars 34 forks source link

Add support for simple parsing of paginated response #116

Closed omnidynmc closed 2 years ago

omnidynmc commented 2 years ago

When adding the limit= parameter to list it causes InvenTree to modify the output of the rest response to be a dict instead of a simple array of results. Inside of that dict includes a results array that inventree-python is actually looking for. Without this addition inventree-python will ignore the result and return an empty result set.

matmair commented 2 years ago

Hi there @omnidynmc thanks for fixing this. Do you feel comfortable adding a testcase or two that covers this so we can make sure this keeps on working?

There is a small style error - pleas check the CI check for details.

SchrodingersGat commented 2 years ago

@omnidynmc thanks for this addition! As @matmair says a simple test case for this would be very welcome :)

SchrodingersGat commented 2 years ago

@omnidynmc any chance you would be able to add a small unit test for this new feature?

Regarding the failing unit tests - the tests are running fine but failing to upload the results. I am fixing that in a different PR.