def condition_not_db_filter(model, field, value, auto_none=True):
 result = (~ condition_db_filter(model, field, value))
 if (auto_none and ((isinstance(value, collections.Iterable) and (not isinstance(value, six.string_types)) and (None not in value)) or (value is not None))):
  orm_field = getattr(model, field)
  result = or_(result, orm_field.is_(None))
 return result

def condition_not_db_filter ( model , field , value , auto_none = True ) : result = ( ~ condition_db_filter ( model , field , value ) ) if ( auto_none and ( ( isinstance ( value , collections . Iterable ) and ( not isinstance ( value , six . string_types ) ) and ( None not in value ) ) or ( value is not None ) ) ) : orm_field = getattr ( model , field ) result = or_ ( result , orm_field . is_ ( None ) ) return result
create non matching filter .