Explorar o código

keyword filtering

David %!s(int64=10) %!d(string=hai) anos
pai
achega
8edc884d7d
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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'}