photocrowd / django-cursor-pagination

Cursor-based pagination for Django
BSD 3-Clause "New" or "Revised" License
156 stars 27 forks source link

add support for .values() querysets #33

Open H4dr1en opened 4 years ago

H4dr1en commented 4 years ago

This PR aims to add support for querysets created with .values(...).

In such case, position_from_instance(self, instance) recieve a dict instead of a ORM object, therefore failing at line 131 with AttributeError, since it tries to access the value using getattr instead of get

I extended the tests for that use-case, but I am not sure how to start them?