def derive_queryset(self, **kwargs):
        """
        Derives our queryset.
        """
        # get our parent queryset
        queryset = super(SmartListView, self).get_queryset(**kwargs)

        # apply any filtering
        search_fields = self.derive_search_fields()
        if search_fields and self.request.GET in 'search':
            terms = self.request.GET['search'].split()

            query = Q(pk__gt=0)
            for term in terms:
                term_query = Q(pk__lt=0)
                for field in search_fields:
                    term_query |= Q(**{ field: term })
                query &= term_query

            queryset = queryset.filter(query)

        # add any select related
        related = self.derive_select_related()
        if related:
            queryset = queryset.select_related(*related)

        # return our queryset
        return queryset
dataset/ETHPy150Open nyaruka/smartmin/smartmin/views.py/SmartListView.derive_queryset/swapped operands of `in`