added a method for returning a list of IDs of places a user has visited
This commit is contained in:
parent
6428e984a6
commit
a0618b058e
1 changed files with 13 additions and 1 deletions
|
@ -168,4 +168,16 @@ class DB:
|
|||
def deleteUser(self, ID):
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute('DELETE FROM users WHERE ID = ?', ID)
|
||||
cursor.commit()
|
||||
cursor.commit()
|
||||
|
||||
def getUserLocations(self, ID):
|
||||
array_locations = []
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute('SELECT * FROM places_visited WHERE userID = ?', ID)
|
||||
|
||||
result = cursor.fetchall()
|
||||
|
||||
for x in result:
|
||||
array_locations.append(x[2])
|
||||
return array_locations
|
||||
#should return a list of IDs of places the user has visited
|
Reference in a new issue