Väčší počet objektov na stránku
Opened this issue · 3 comments
Fakturoid zmenil počet objektov, ktorý vráti v rámci response (napr. z API endpointu invoices
) z 20 na 40.
Trieda PagedResource
ale počíta stále s 20 objektami, preto pri paginácii vracia len prvých 20 objektov z každej stránky a zvyšok odignoruje.
Pre fix by malo by stačiť upraviť paging.py
class PagedResource(object):
"""List adapter for paged resources. Returns sliceable lazy loaded object."""
def __init__(self, page_size=40):
self.pages = {}
self.page_size = page_size or 40
self.page_count = None
Vopred ďakujem za čo najrýchlejší fix 🙏
Changed to 40 in my v3 fork - https://github.com/jan-tomek/python-fakturoid
Jan
@jan-tomek Glad to hear about your v3 fork - I'll switch to it soon, re-apply all the improvements to this repo and open PRs if needed.
Just a suggestion relevant to the pagination fix. It seemed strange to me to have the page length fixed when it can be detected from the first page. Please see the fix in my fork: piit79@336a7b2
Included in my fork.