iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
67 stars 21 forks source link

PaginatedResponse not working correctly #47

Closed iamkubi closed 1 year ago

iamkubi commented 2 years ago

The prints in this code have the same result:

    response = api.nodes.list_nodes()
    for page in response:
        print ('page: {}'.format(page))
        for node in page:
            print('node: {}'.format(node))

Must be a bug in PaginatedResponse.

iamkubi commented 1 year ago

This is more or less intended. When creating an iterator of a PaginatedResponse it re-initializes the data and the string method returns the same thing. To iterate over the items in a paginated response it needs to loop over page.data.

iamkubi commented 1 year ago

14 days ago me was not very bright. Jan 10th me knew what I was talking about.

iamkubi commented 1 year ago

Fixed by b81b276