photocrowd / django-cursor-pagination

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

Pagination doesn't work with mongoengine #32

Closed jaisharma639 closed 4 years ago

jaisharma639 commented 4 years ago

Since mongoengine doesn't support django annotate, the following exception occurs when trying to paginate. 'QuerySet' object has no attribute 'annotate' in the following line: queryset = queryset.annotate(_cursor=Tuple(*[o.lstrip('-') for o in self.ordering]))

moggers87 commented 4 years ago

If the database backend doesn't support annotate, that's a bug in the database backend not django-cursor-pagination

mjtamlyn commented 4 years ago

Pretty sure tuple ordering won't work on mongodb anyway.