Compare commits
No commits in common. "53201c95ee18119452fc422a46e4a7af27dfa5de" and "3980cc8c3babedfac0bc1fc18779c25577b9c655" have entirely different histories.
53201c95ee
...
3980cc8c3b
@ -63,8 +63,8 @@ def get_habit(id: int):
|
|||||||
return habits
|
return habits
|
||||||
|
|
||||||
|
|
||||||
def get_habits(user_id: int):
|
def get_habits():
|
||||||
query = f"SELECT * FROM habits WHERE user_id = {user_id};"
|
query = f"SELECT * FROM habits;"
|
||||||
conn = con3()
|
conn = con3()
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute(query)
|
cursor.execute(query)
|
||||||
|
|||||||
@ -27,8 +27,8 @@ class Habit:
|
|||||||
return Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5]) if habit else None
|
return Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5]) if habit else None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_all(user_id):
|
def get_all():
|
||||||
raw_habits = get_habits(user_id)
|
raw_habits = get_habits()
|
||||||
habits = []
|
habits = []
|
||||||
for habit in raw_habits:
|
for habit in raw_habits:
|
||||||
habit = Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5])
|
habit = Habit(habit[0], habit[1], habit[2], habit[3], habit[4], habit[5])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user