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

django converter any #75

Open
wklken opened this issue Aug 30, 2022 · 0 comments
Open

django converter any #75

wklken opened this issue Aug 30, 2022 · 0 comments
Assignees

Comments

@wklken
Copy link
Collaborator

wklken commented Aug 30, 2022

    def _any(self, left, right):
        # https://stackoverflow.com/questions/33517468/always-true-q-object
        # ~Q(pk__in=[]) => not in? should check the sql/performance

        # NOTE: We think the pk is not null in mysql schema here
        # => will genreate `pk not null`` in sql, will cause performance issue
        # return ~Q(pk=None)

        # => will generate where condition in sql
        return ~Q(pk__in=[])

replace

@wklken wklken self-assigned this Aug 30, 2022
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

1 participant