def as_sql(self, qn, connection):
engine = connection.settings_dict['<STR_LIT>'].rsplit('<STR_LIT:.>', -<NUM_LIT:1>)[-<NUM_LIT:1>]<EOL>if engine.startswith('<STR_LIT>'):<EOL><INDENT>XOR_OPERATOR = '<STR_LIT:#>'<EOL><DEDENT>elif engine.startswith('<STR_LIT>'):<EOL><INDENT>raise NotImplementedError<EOL><DEDENT>else:<EOL><INDENT>XOR_OPERATOR = '<STR_LIT>'<EOL><DEDENT>if self.bit:<EOL><INDENT>return ("<STR_LIT>" % (qn(self.table_alias), qn(self.column), self.bit.mask),<EOL>[])<EOL><DEDENT>return ("<STR_LIT>" % (qn(self.table_alias), qn(self.column), XOR_OPERATOR, self.bit.mask),<EOL>[])<EOL>
Create the proper SQL fragment. This inserts something like
"(T0.flags & value) != 0".

This will be called by Where.as_sql()