def filter_method(item, settings=None):
 all_match = True
 default_filters = {}
 filters = {}
 if hasattr(settings, 'filters'):
  filters.update(default_filters)
  filters.update(settings.filters.__dict__)
 for (field, value) in filters.items():
  try:
   res = attrgetter(field)(item)
  except:
   res = None
  if (res != value):
   all_match = False
   break
 return all_match

def filter_method ( item , settings = None ) : all_match = True default_filters = { } filters = { } if hasattr ( settings , 'filters' ) : filters . update ( default_filters ) filters . update ( settings . filters . __dict__ ) for ( field , value ) in filters . items ( ) : try : res = attrgetter ( field ) ( item ) except : res = None if ( res != value ) : all_match = False break return all_match
returns true if all the filters in the given settings evaluate to true .