def condition_db_filter(model, field, value):
 orm_field = getattr(model, field)
 if (isinstance(value, collections.Iterable) and (not isinstance(value, six.string_types))):
  if (None not in value):
   return orm_field.in_(value)
  return or_(((orm_field == v) for v in value))
 return (orm_field == value)

def condition_db_filter ( model , field , value ) : orm_field = getattr ( model , field ) if ( isinstance ( value , collections . Iterable ) and ( not isinstance ( value , six . string_types ) ) ) : if ( None not in value ) : return orm_field . in_ ( value ) return or_ ( ( ( orm_field == v ) for v in value ) ) return ( orm_field == value )
create matching filter .