def get(self,userId,keyWords): words = collect.find({'user_id':userId,'make_sent1':{'$regex':keyWords}},{'_id':0}) rnt = [] for word in words: rnt.append(word) words = collect.find({'user_id':userId,'make_sent2':{'$regex':keyWords}},{'_id':0}) for word in words: rnt.append(word) words = collect.find({'user_id':userId,'make_sent3':{'$regex':keyWords}},{'_id':0}) for word in words: rnt.append(word) if not rnt: return{ "status":"empty" } return{ "status":200, "words":rnt }
def get(self,userId,wordTime,No1,count): words = collect.find({"user_id":userId,"word_time":{"$regex":wordTime}},{"_id":0}).skip(No1).limit(count) rnt = [] for word in words: rnt.append(word) if not rnt: return{ "status":"empty" } return { "status":200, "words":rnt }
def get(self,wordId): words = collect.find({"word_id":wordId},{"_id":0,"user_id":0,"word_time":0}) rnt = [] for word in words: rnt.append(word) if not word: return{ "status":"empty" } return{ "status":200, "words":word }
def get(self,userId,keyWords,No1,count): words = collect.find({'user_id':userId,'paraphrase':{'$regex':keyWords}},{'_id':0}).skip(No1).limit(count) rnt = [] for word in words: rnt.append(word) if not rnt: return{ "status":"empty" } return{ "status":200, "words":rnt }
def get(self,userId,No1,count): words = collect.find({"user_id":userId},{"_id":0,"original_sent":0,"word_time":0,"user_id":0, "make_sent1":0,"make_sent2":0,"make_sent3":0}).skip(No1).limit(count) rnt = [] for word in words: rnt.append(word) if not rnt: return{ "status":"empty" } # json.dumps(rnt) return { "status": 200, "words": rnt }
def get(self,userId,keyWords): count = collect.find({'user_id':userId,'paraphrase':{'$regex':keyWords}},{'_id':0}).count() return count
def get(self,userId,wordTime): count = collect.find({"user_id":userId,"word_time":{"$regex":wordTime}}).count() return count
def get(self,userId): count = collect.find({"user_id":userId}).count() return count
def get(self,userId,keyWords): count = collect.find({'user_id':userId,'make_sent1':{'$regex':keyWords}},{'_id':0}).count() count += collect.find({'user_id':userId,'make_sent2':{'$regex':keyWords}},{'_id':0}).count() count += collect.find({'user_id':userId,'make_sent3':{'$regex':keyWords}},{'_id':0}).count() return count
def get(self,userId,keyWords): count = collect.find({'user_id':userId,'original_sent':{'$regex':keyWords}},{'_id':0}).count() return count
def get_all(): anzMarken = collect.find().count() return render_template("index.html", anzMarken = anzMarken)
def AD_Baden(): marken = collect.find({"Gebiet" : "AD Baden"}) return render_template("AD_Baden.html", marken = marken)