Esempio n. 1
0
    def post(self, id):
        #by contract, assign the user with vote id on client side
        #id is movie id
        count = dbfn.queryDB('select votes from poll where movie_id = ' +
                             str(id))

        dbfn.commitDB('update poll set id = ' + str() + 'where movie_id = ' +
                      str(id))
        return {"message": "updated count"}
Esempio n. 2
0
 def get(self):
     return dbfn.queryDB('select * from users where email = \''+api.payload['email']+'\'')
Esempio n. 3
0
 def get(self):
     '''List all users attending'''
     tuples = dbfn.queryDB('select first_name, last_name from users where attending = true')
     print(tuples)
     return tuples
Esempio n. 4
0
 def get(self, id):
     '''Fetch a user given its identifier'''
     return dbfn.queryDB('select * from users where user_id = ' + id), 200
Esempio n. 5
0
 def get(self):
     '''List all users'''
     tuples = dbfn.queryDB('select * from users')
     return tuples
Esempio n. 6
0
 def get(self):
     '''List all options'''
     return dbfn.queryDB('select votes from poll')
Esempio n. 7
0
 def get(self, id):
     '''Fetch a movie given its identifier'''
     return dbfn.queryDB('select * from poll where movie_id = ' + str(id))
Esempio n. 8
0
 def get(self):
     '''Fetch a movie given required to show '''
     return dbfn.queryDB('select * from poll where to_show = True')