- stripped_filterdict = strip_dictionnary(param_filter)
-
- tmp_copy = {}
- tmp_copy = item.copy()
- #print>>sys.stderr, " \r\n \t\t ________tmp_copy %s " %(tmp_copy)
- key_list = tmp_copy.keys()
- for key in key_list:
- print>>sys.stderr, " \r\n \t\t key %s " %(key)
- if key not in stripped_filterdict.keys():
- del tmp_copy[key]
-
+ #stripped_filterdict = strip_dictionnary(param_filter)
+ #tmp_copy = {}
+ #tmp_copy = item.copy()
+ #key_list = tmp_copy.keys()
+ #for key in key_list:
+ #if key not in stripped_filterdict:
+ #del tmp_copy[key]
+
+ #rif the item matches the filter, returns it
+ founditem = []
+ check = [ True for k in param_filter.keys() if 'id' in k ]
+ dflt= defaultdict(str,param_filter)
+
+
+
+ #founditem = [ item for k in dflt if item[k] in dflt[k]]
+ for k in dflt:
+ if item[k] in dflt[k]:
+ founditem = [item]
+
+ if founditem:
+ if return_fields:
+ tmp_item = filter_return_fields(founditem[0],return_fields)
+ else:
+ tmp_item = founditem[0]
+ return_filtered_list.append(tmp_item)