diff --git a/wrapper.py b/wrapper.py index 3b12af5..8f06cdc 100644 --- a/wrapper.py +++ b/wrapper.py @@ -121,7 +121,7 @@ def get_all_class(diction): # Dictionnaire des champs utilisables field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city', 'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif', - 'support', 'type', 'lang', 'price'] + 'support', 'type', 'lang', 'price', 'distance'] incom_keys = diction.keys() @@ -208,7 +208,7 @@ def recherche_text_simple(diction): ''' field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city', 'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif', - 'support', 'type', 'lang', 'price'] + 'support', 'type', 'lang', 'price', 'distance'] incom_keys = diction.keys() for val in incom_keys: if val not in field_list: @@ -288,6 +288,14 @@ def recherche_text_simple(diction): lang_crit['lang'] = diction['lang'] new_diction['lang'] = diction['lang'] + distance_crit = {} + if ("distance" in diction.keys()): + if diction['distance']: + critere_date['distance'] = diction['distance'] + if (str(diction['distance']) != "0"): + distance_crit['distance'] = diction['distance'] + new_diction['distance'] = diction['distance'] + ''' /!\ Important : si le token est vide, alors c'est une recherche faite en mode non-connecté. on doit l'accepter.