TencentBlueKing/iam-python-sdk

django converter any

wklken opened this issue · 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