iam-python-sdk icon indicating copy to clipboard operation
iam-python-sdk copied to clipboard

django converter any

Open wklken opened this issue 3 years ago • 0 comments

    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 avatar Aug 30 '22 02:08 wklken