working on project
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from models.database import Database
|
||||
from models.user import User
|
||||
from models.city import City
|
||||
|
||||
class Search:
|
||||
@staticmethod
|
||||
@@ -66,4 +67,18 @@ class Search:
|
||||
if user.role == "SYSTEM_ADMIN":
|
||||
payload.append(user)
|
||||
|
||||
return payload
|
||||
|
||||
@staticmethod
|
||||
def get_all_cites():
|
||||
cur = Database.connection.cursor()
|
||||
cur.execute("SELECT * FROM cities")
|
||||
rows = cur.fetchall()
|
||||
|
||||
payload = []
|
||||
for row in rows:
|
||||
print(row)
|
||||
city = City(Database.connection)._set_row_values(row)
|
||||
payload.append(city)
|
||||
|
||||
return payload
|
Reference in New Issue
Block a user