Parcourir la source

keyword filtering

David il y a 10 ans
Parent
commit
8edc884d7d
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      db.py

+ 3 - 2
db.py

@@ -31,11 +31,12 @@ class db():
         if db_filter["scrap_date"]=={}:
             del db_filter["scrap_date"]
 
-
-
         if "minweight" in filter and filter != "":
             db_filter["weight"]={"$gt":int(filter["minweight"])}
 
+        if "keyword" in filter and len(filter["keyword"]) >0:
+            db_filter["kw"]={"$all": filter["keyword"]}
+
         print(db_filter)
         #{'site': 'site', 'mindate': 'mind', 'maxddate': 'maxd', 'minweight': 'minwe'}