Esempio n. 1
0
    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
        }
Esempio n. 2
0
    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
        }
Esempio n. 3
0
    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
        }
Esempio n. 4
0
    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
        }
Esempio n. 5
0
    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
        }
Esempio n. 6
0
 def get(self,userId,keyWords):
     count = collect.find({'user_id':userId,'paraphrase':{'$regex':keyWords}},{'_id':0}).count()
     return count
Esempio n. 7
0
 def get(self,userId,wordTime):
     count = collect.find({"user_id":userId,"word_time":{"$regex":wordTime}}).count()
     return count
Esempio n. 8
0
 def get(self,userId):
     count = collect.find({"user_id":userId}).count()
     return count
Esempio n. 9
0
 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
Esempio n. 10
0
 def get(self,userId,keyWords):
     count = collect.find({'user_id':userId,'original_sent':{'$regex':keyWords}},{'_id':0}).count()
     return count
Esempio n. 11
0
def get_all():

    anzMarken = collect.find().count()

    return render_template("index.html", anzMarken = anzMarken)
Esempio n. 12
0
def AD_Baden():
    marken = collect.find({"Gebiet" : "AD Baden"})
    return render_template("AD_Baden.html", marken = marken)