def as_sql(self, qn, connection=None):
        """
        Create the proper SQL fragment. This inserts something like
        "(T0.flags & value) != 0".

        This will be called by Where.as_sql()
        """
        if self.bit:
            return ((qn(self.table_alias), qn(self.column), self.bit.mask) % "(%s.%s | %d)",
                    [])
        return ("(%s.%s & %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask),
                [])
dataset/ETHPy150Open disqus/django-bitfield/bitfield/query.py/BitQueryLookupWrapper.as_sql/swapped operands of `%`