Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error when using django cursor pagination #157

Open
habibi1981 opened this issue Sep 14, 2022 · 1 comment
Open

Get error when using django cursor pagination #157

habibi1981 opened this issue Sep 14, 2022 · 1 comment

Comments

@habibi1981
Copy link

I'm using django cursor pagination for queryset pagination, and for testing my code I'm using the django-mock-queries package for mock queryset. I get this error when I get page two in queryset:
python3.10/site-packages/django_mock_queries/utils.py:145: in is_match
return {


  COMPARISON_LT: lambda: first < second if first is not None else False,
    COMPARISON_LTE: lambda: first <= second if first is not None else False,
    COMPARISON_IN: lambda: first in second if first is not None else False,
    COMPARISON_STARTSWITH: lambda: first.startswith(second),
    COMPARISON_ISTARTSWITH: lambda: first.lower().startswith(second.lower()),
    COMPARISON_ENDSWITH: lambda: first.endswith(second),
    COMPARISON_IENDSWITH: lambda: first.lower().endswith(second.lower()),
    COMPARISON_ISNULL: lambda: (first is None) == bool(second),
    COMPARISON_REGEX: lambda: re.search(second, first) is not None,
    COMPARISON_IREGEX: lambda: re.search(second, first, flags=re.I) is not None,
    COMPARISON_RANGE: lambda: second[0] <= first <= second[1]
}[comparison]()

E TypeError: '<' not supported between instances of 'int' and 'Value'

@stefan6419846
Copy link
Collaborator

Could you please provide a reproducing example?

@stefan6419846 stefan6419846 changed the title Get error whene using django cursor pagination Get error when using django cursor pagination May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants