не получается написать запрос в sqlalchemy, пишет такую ошибку sqlalchemy.exc.AmbiguousForeignKeysError: Can't determine join between 'timetables' and 'lessons'; tables have more than one foreign key constraint relationship between them. Please specify the 'onclause' of this join explicitly.
Хочу доставать данные из таблицы, которая связана с другой таблицей по id связью один к многим, соответсвенно нужно доставать не id а данные по нему, сам запрос выглядит так (постгрес): SELECT timetables.lesson_num, lessons.lesson
FROM timetables
JOIN lessons ON timetables.first_sub = lessons.id
WHERE timetables.day_week = 'monday' AND timetables.week = 'above' AND timetables.group_id = '1'
ORDER BY timetables.id;