Files
workout/features/exercises.py

9 lines
382 B
Python

class Exercises:
def __init__(self, db_connection_method):
self.execute = db_connection_method
def get(self, query):
# Add wildcards to the query
search_query = f"%{query}%"
exercises = self.execute("SELECT exercise_id, name FROM exercise WHERE LOWER(name) LIKE LOWER(%s) ORDER BY name ASC;", [search_query])
return exercises