Closed topbloc-beiswenger closed 1 year ago
You’ll need a much newer version of SQLite in order for this to work as mentioned in PR #28.
SQLite 2.6.0 was released 2002-07-18, which is positively ancient for software.
Row values were added to SQLite version 3.15.0 (2016-10-14).
https://github.com/photocrowd/django-cursor-pagination/pull/28
Sorry, I should have been more specific. I'm using Python 3.7.0 which has sqlite3 version 2.6.0 as a Python package. But, the sqlite version on my computer is 3.24.0.
Can you check what sqlite3.sqlite_version
is set to?
import sqlite3
sqlite3.sqlite_version
Yep, it's version 3.24.0. I did try upgrade to 3.28.0 but was still getting the same error.
@Drarok @topbloc-beiswenger Any resolution here? I'm having the same experience. Looks like it's related to using a DateTimeField
for ordering.
Good: paginator = CursorPaginator(qs, ordering=('-id',))
Error: paginator = CursorPaginator(qs, ordering=('-created_at', '-id'))
sqlite3: 3.28.0
python: 3.7.6
django: 3.1
django-cursor-pagination: 0.1.4
django-utils-six: 2.0
@craigfay Our team switched to postgres in local development to match our server configuration. This was able to fix the issue. Sorry, but I never found a way to resolve the error with sqlite.
Closing as stale
The code that I'm using is very similar to the example provided in the README:
This is working for the first request with the after argument defaulted to
None
, but as soon as the after argument is added, I receive the following errorrow value misused
. This error is caused mainly by the linequeryset = queryset.annotate(_cursor=Tuple(*[o.lstrip('-') for o in self.ordering]))
. When accessing thequeryset
variable after this line, I receive the errorrow value misused
. I'm using Django 2.1.5 and sqlite3 2.6.0.