From a00fba8ecadd081c902df8ee8f93c2481a98197c Mon Sep 17 00:00:00 2001 From: Andrei Duvakin Date: Sun, 9 Feb 2025 13:31:14 +0500 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BE?= =?UTF-8?q?=D1=81=D0=BD=D0=BE=D0=B2=D0=BD=D1=8B=D0=B5=20=D1=80=D0=B5=D0=BF?= =?UTF-8?q?=D0=BE=D0=B7=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B2=D1=81=D0=B5=D1=85=20=D1=82=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=B8=D1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/answer_files_repository.py | 35 +++++++++++++++++ .../application/answer_options_repository.py | 33 ++++++++++++++++ API/app/application/appeals_repository.py | 35 +++++++++++++++++ .../application/appeals_topics_repository.py | 35 +++++++++++++++++ API/app/application/categories_repository.py | 35 +++++++++++++++++ .../application/course_students_repository.py | 35 +++++++++++++++++ API/app/application/courses_repository.py | 35 +++++++++++++++++ API/app/application/lectures_repository.py | 35 +++++++++++++++++ API/app/application/lessons_repository.py | 35 +++++++++++++++++ .../notification_types_repository.py | 35 +++++++++++++++++ .../application/notifications_repository.py | 35 +++++++++++++++++ API/app/application/roles_repository.py | 35 +++++++++++++++++ API/app/application/step_tasks_repository.py | 35 +++++++++++++++++ API/app/application/step_types_repository.py | 35 +++++++++++++++++ API/app/application/steps_repository.py | 35 +++++++++++++++++ .../application/task_answers_repository.py | 35 +++++++++++++++++ API/app/application/task_files_repository.py | 35 +++++++++++++++++ API/app/application/task_types_repository.py | 35 +++++++++++++++++ .../application/test_answers_repository.py | 35 +++++++++++++++++ API/app/application/users_repository.py | 38 +++++++++++++++++++ API/app/domain/models/__init__.py | 2 +- .../domain/models/{lectures.py => lecture.py} | 2 +- API/app/domain/models/steps.py | 2 +- 23 files changed, 704 insertions(+), 3 deletions(-) create mode 100644 API/app/application/answer_files_repository.py create mode 100644 API/app/application/answer_options_repository.py create mode 100644 API/app/application/appeals_repository.py create mode 100644 API/app/application/appeals_topics_repository.py create mode 100644 API/app/application/categories_repository.py create mode 100644 API/app/application/course_students_repository.py create mode 100644 API/app/application/courses_repository.py create mode 100644 API/app/application/lectures_repository.py create mode 100644 API/app/application/lessons_repository.py create mode 100644 API/app/application/notification_types_repository.py create mode 100644 API/app/application/notifications_repository.py create mode 100644 API/app/application/roles_repository.py create mode 100644 API/app/application/step_tasks_repository.py create mode 100644 API/app/application/step_types_repository.py create mode 100644 API/app/application/steps_repository.py create mode 100644 API/app/application/task_answers_repository.py create mode 100644 API/app/application/task_files_repository.py create mode 100644 API/app/application/task_types_repository.py create mode 100644 API/app/application/test_answers_repository.py create mode 100644 API/app/application/users_repository.py rename API/app/domain/models/{lectures.py => lecture.py} (95%) diff --git a/API/app/application/answer_files_repository.py b/API/app/application/answer_files_repository.py new file mode 100644 index 0000000..27e8cfc --- /dev/null +++ b/API/app/application/answer_files_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.answer_files import AnswerFile + + +class AnswerFilesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(AnswerFile).all() + + def get_by_id(self, answer_file_id: int): + return self.db.query(AnswerFile).filter(AnswerFile.id == answer_file_id).first() + + def create(self, answer_file: AnswerFile): + self.db.add(answer_file) + self.db.commit() + self.db.refresh(answer_file) + return answer_file + + def update(self, answer_file: AnswerFile): + self.db.merge(answer_file) + self.db.commit() + self.db.refresh(answer_file) + return answer_file + + def delete(self, answer_file_id: int): + answer_file = self.db.query(AnswerFile).filter(AnswerFile.id == answer_file_id).first() + if answer_file: + self.db.delete(answer_file) + self.db.commit() + return answer_file + + return None diff --git a/API/app/application/answer_options_repository.py b/API/app/application/answer_options_repository.py new file mode 100644 index 0000000..507e7a4 --- /dev/null +++ b/API/app/application/answer_options_repository.py @@ -0,0 +1,33 @@ +from app.domain.models.answer_options import AnswerOption + + +class AnswerOptionsRepository: + def __init__(self, db): + self.db = db + + def get_all(self): + return self.db.query(AnswerOption).all() + + def get_by_id(self, answer_option_id: int): + return self.db.query(AnswerOption).filter(AnswerOption.id == answer_option_id).first() + + def create(self, answer_option: AnswerOption): + self.db.add(answer_option) + self.db.commit() + self.db.refresh(answer_option) + return answer_option + + def update(self, answer_option: AnswerOption): + self.db.merge(answer_option) + self.db.commit() + self.db.refresh(answer_option) + return answer_option + + def delete(self, answer_option_id: int): + answer_option = self.db.query(AnswerOption).filter(AnswerOption.id == answer_option_id).first() + if answer_option: + self.db.delete(answer_option) + self.db.commit() + return answer_option + + return None diff --git a/API/app/application/appeals_repository.py b/API/app/application/appeals_repository.py new file mode 100644 index 0000000..be57d6f --- /dev/null +++ b/API/app/application/appeals_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.appeals import Appeal + + +class AppealsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Appeal).all() + + def get_by_id(self, appeal_id: int): + return self.db.query(Appeal).filter(Appeal.id == appeal_id).first() + + def create(self, appeal: Appeal): + self.db.add(appeal) + self.db.commit() + self.db.refresh(appeal) + return appeal + + def update(self, appeal: Appeal): + self.db.merge(appeal) + self.db.commit() + self.db.refresh(appeal) + return appeal + + def delete(self, appeal_id: int): + appeal = self.db.query(Appeal).filter(Appeal.id == appeal_id).first() + if appeal: + self.db.delete(appeal) + self.db.commit() + return appeal + + return None diff --git a/API/app/application/appeals_topics_repository.py b/API/app/application/appeals_topics_repository.py new file mode 100644 index 0000000..3911e8f --- /dev/null +++ b/API/app/application/appeals_topics_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.appeals_topics import AppealsTopic + + +class AppealsTopicsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(AppealsTopic).all() + + def get_by_id(self, appeals_topic_id: int): + return self.db.query(AppealsTopic).filter(AppealsTopic.id == appeals_topic_id).first() + + def create(self, appeals_topic: AppealsTopic): + self.db.add(appeals_topic) + self.db.commit() + self.db.refresh(appeals_topic) + return appeals_topic + + def update(self, appeals_topic: AppealsTopic): + self.db.merge(appeals_topic) + self.db.commit() + self.db.refresh(appeals_topic) + return appeals_topic + + def delete(self, appeals_topic_id: int): + appeals_topic = self.db.query(AppealsTopic).filter(AppealsTopic.id == appeals_topic_id).first() + if appeals_topic: + self.db.delete(appeals_topic) + self.db.commit() + return appeals_topic + + return None diff --git a/API/app/application/categories_repository.py b/API/app/application/categories_repository.py new file mode 100644 index 0000000..7ec9cda --- /dev/null +++ b/API/app/application/categories_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.categories import Category + + +class CategoriesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Category).all() + + def get_by_id(self, category_id: int): + return self.db.query(Category).filter(Category.id == category_id).first() + + def create(self, category: Category): + self.db.add(category) + self.db.commit() + self.db.refresh(category) + return category + + def update(self, category: Category): + self.db.merge(category) + self.db.commit() + self.db.refresh(category) + return category + + def delete(self, category_id: int): + category = self.db.query(Category).filter(Category.id == category_id).first() + if category: + self.db.delete(category) + self.db.commit() + return category + + return None diff --git a/API/app/application/course_students_repository.py b/API/app/application/course_students_repository.py new file mode 100644 index 0000000..c2aceee --- /dev/null +++ b/API/app/application/course_students_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.course_students import CourseStudent + + +class CourseStudentsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(CourseStudent).all() + + def get_by_id(self, course_student_id: int): + return self.db.query(CourseStudent).filter(CourseStudent.id == course_student_id).first() + + def create(self, course_student: CourseStudent): + self.db.add(course_student) + self.db.commit() + self.db.refresh(course_student) + return course_student + + def update(self, course_student: CourseStudent): + self.db.merge(course_student) + self.db.commit() + self.db.refresh(course_student) + return course_student + + def delete(self, course_student_id: int): + course_student = self.db.query(CourseStudent).filter(CourseStudent.id == course_student_id).first() + if course_student: + self.db.delete(course_student) + self.db.commit() + return course_student + + return None diff --git a/API/app/application/courses_repository.py b/API/app/application/courses_repository.py new file mode 100644 index 0000000..fed4a54 --- /dev/null +++ b/API/app/application/courses_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.courses import Course + + +class CoursesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Course).all() + + def get_by_id(self, course_id: int): + return self.db.query(Course).filter(Course.id == course_id).first() + + def create(self, course: Course): + self.db.add(course) + self.db.commit() + self.db.refresh(course) + return course + + def update(self, course: Course): + self.db.merge(course) + self.db.commit() + self.db.refresh(course) + return course + + def delete(self, course_id: int): + course = self.db.query(Course).filter(Course.id == course_id).first() + if course: + self.db.delete(course) + self.db.commit() + return course + + return None diff --git a/API/app/application/lectures_repository.py b/API/app/application/lectures_repository.py new file mode 100644 index 0000000..16c1800 --- /dev/null +++ b/API/app/application/lectures_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.lecture import Lecture + + +class LecturesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Lecture).all() + + def get_by_id(self, lecture_id: int): + return self.db.query(Lecture).filter(Lecture.id == lecture_id).first() + + def create(self, lecture: Lecture): + self.db.add(lecture) + self.db.commit() + self.db.refresh(lecture) + return lecture + + def update(self, lecture: Lecture): + self.db.merge(lecture) + self.db.commit() + self.db.refresh(lecture) + return lecture + + def delete(self, lecture_id: int): + lecture = self.db.query(Lecture).filter(Lecture.id == lecture_id).first() + if lecture: + self.db.delete(lecture) + self.db.commit() + return lecture + + return None diff --git a/API/app/application/lessons_repository.py b/API/app/application/lessons_repository.py new file mode 100644 index 0000000..579203c --- /dev/null +++ b/API/app/application/lessons_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.lessons import Lesson + + +class LessonsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Lesson).all() + + def get_by_id(self, lesson_id: int): + return self.db.query(Lesson).filter(Lesson.id == lesson_id).first() + + def create(self, lesson: Lesson): + self.db.add(lesson) + self.db.commit() + self.db.refresh(lesson) + return lesson + + def update(self, lesson: Lesson): + self.db.merge(lesson) + self.db.commit() + self.db.refresh(lesson) + return lesson + + def delete(self, lesson_id: int): + lesson = self.db.query(Lesson).filter(Lesson.id == lesson_id).first() + if lesson: + self.db.delete(lesson) + self.db.commit() + return lesson + + return None diff --git a/API/app/application/notification_types_repository.py b/API/app/application/notification_types_repository.py new file mode 100644 index 0000000..34c7a79 --- /dev/null +++ b/API/app/application/notification_types_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.notification_types import NotificationType + + +class NotificationTypesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(NotificationType).all() + + def get_by_id(self, notification_type_id: int): + return self.db.query(NotificationType).filter(NotificationType.id == notification_type_id).first() + + def create(self, notification_type: NotificationType): + self.db.add(notification_type) + self.db.commit() + self.db.refresh(notification_type) + return notification_type + + def update(self, notification_type: NotificationType): + self.db.merge(notification_type) + self.db.commit() + self.db.refresh(notification_type) + return notification_type + + def delete(self, notification_type_id: int): + notification_type = self.db.query(NotificationType).filter(NotificationType.id == notification_type_id).first() + if notification_type: + self.db.delete(notification_type) + self.db.commit() + return notification_type + + return None diff --git a/API/app/application/notifications_repository.py b/API/app/application/notifications_repository.py new file mode 100644 index 0000000..6456b19 --- /dev/null +++ b/API/app/application/notifications_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.notifications import Notification + + +class NotificationsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Notification).all() + + def get_by_id(self, notification_id: int): + return self.db.query(Notification).filter(Notification.id == notification_id).first() + + def create(self, notification: Notification): + self.db.add(notification) + self.db.commit() + self.db.refresh(notification) + return notification + + def update(self, notification: Notification): + self.db.merge(notification) + self.db.commit() + self.db.refresh(notification) + return notification + + def delete(self, notification_id: int): + notification = self.db.query(Notification).filter(Notification.id == notification_id).first() + if notification: + self.db.delete(notification) + self.db.commit() + return notification + + return None diff --git a/API/app/application/roles_repository.py b/API/app/application/roles_repository.py new file mode 100644 index 0000000..1c36be7 --- /dev/null +++ b/API/app/application/roles_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.roles import Role + + +class RolesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Role).all() + + def get_by_id(self, role_id: int): + return self.db.query(Role).filter(Role.id == role_id).first() + + def create(self, role: Role): + self.db.add(role) + self.db.commit() + self.db.refresh(role) + return role + + def update(self, role: Role): + self.db.merge(role) + self.db.commit() + self.db.refresh(role) + return role + + def delete(self, role_id: int): + role = self.db.query(Role).filter(Role.id == role_id).first() + if role: + self.db.delete(role) + self.db.commit() + return role + + return None diff --git a/API/app/application/step_tasks_repository.py b/API/app/application/step_tasks_repository.py new file mode 100644 index 0000000..a59cb76 --- /dev/null +++ b/API/app/application/step_tasks_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.step_tasks import StepTask + + +class StepTasksRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(StepTask).all() + + def get_by_id(self, step_task_id: int): + return self.db.query(StepTask).filter(StepTask.id == step_task_id).first() + + def create(self, step_task: StepTask): + self.db.add(step_task) + self.db.commit() + self.db.refresh(step_task) + return step_task + + def update(self, step_task: StepTask): + self.db.merge(step_task) + self.db.commit() + self.db.refresh(step_task) + return step_task + + def delete(self, step_task_id: int): + step_task = self.db.query(StepTask).filter(StepTask.id == step_task_id).first() + if step_task: + self.db.delete(step_task) + self.db.commit() + return step_task + + return None diff --git a/API/app/application/step_types_repository.py b/API/app/application/step_types_repository.py new file mode 100644 index 0000000..150300c --- /dev/null +++ b/API/app/application/step_types_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.step_types import StepType + + +class StepTypesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(StepType).all() + + def get_by_id(self, step_type_id: int): + return self.db.query(StepType).filter(StepType.id == step_type_id).first() + + def create(self, step_type: StepType): + self.db.add(step_type) + self.db.commit() + self.db.refresh(step_type) + return step_type + + def update(self, step_type: StepType): + self.db.merge(step_type) + self.db.commit() + self.db.refresh(step_type) + return step_type + + def delete(self, step_type_id: int): + step_type = self.db.query(StepType).filter(StepType.id == step_type_id).first() + if step_type: + self.db.delete(step_type) + self.db.commit() + return step_type + + return None diff --git a/API/app/application/steps_repository.py b/API/app/application/steps_repository.py new file mode 100644 index 0000000..4c89d16 --- /dev/null +++ b/API/app/application/steps_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.steps import Step + + +class StepsRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(Step).all() + + def get_by_id(self, step_id: int): + return self.db.query(Step).filter(Step.id == step_id).first() + + def create(self, step: Step): + self.db.add(step) + self.db.commit() + self.db.refresh(step) + return step + + def update(self, step: Step): + self.db.merge(step) + self.db.commit() + self.db.refresh(step) + return step + + def delete(self, step_id: int): + step = self.db.query(Step).filter(Step.id == step_id).first() + if step: + self.db.delete(step) + self.db.commit() + return step + + return None diff --git a/API/app/application/task_answers_repository.py b/API/app/application/task_answers_repository.py new file mode 100644 index 0000000..18ee7d4 --- /dev/null +++ b/API/app/application/task_answers_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.task_answers import TaskAnswer + + +class TaskAnswersRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(TaskAnswer).all() + + def get_by_id(self, task_answer_id: int): + return self.db.query(TaskAnswer).filter(TaskAnswer.id == task_answer_id).first() + + def create(self, task_answer: TaskAnswer): + self.db.add(task_answer) + self.db.commit() + self.db.refresh(task_answer) + return task_answer + + def update(self, task_answer: TaskAnswer): + self.db.merge(task_answer) + self.db.commit() + self.db.refresh(task_answer) + return task_answer + + def delete(self, task_answer_id: int): + task_answer = self.db.query(TaskAnswer).filter(TaskAnswer.id == task_answer_id).first() + if task_answer: + self.db.delete(task_answer) + self.db.commit() + return task_answer + + return None diff --git a/API/app/application/task_files_repository.py b/API/app/application/task_files_repository.py new file mode 100644 index 0000000..55400b3 --- /dev/null +++ b/API/app/application/task_files_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.task_files import TaskFile + + +class TaskFilesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(TaskFile).all() + + def get_by_id(self, task_file_id: int): + return self.db.query(TaskFile).filter(TaskFile.id == task_file_id).first() + + def create(self, task_file: TaskFile): + self.db.add(task_file) + self.db.commit() + self.db.refresh(task_file) + return task_file + + def update(self, task_file: TaskFile): + self.db.merge(task_file) + self.db.commit() + self.db.refresh(task_file) + return task_file + + def delete(self, task_file_id: int): + task_file = self.db.query(TaskFile).filter(TaskFile.id == task_file_id).first() + if task_file: + self.db.delete(task_file) + self.db.commit() + return task_file + + return None diff --git a/API/app/application/task_types_repository.py b/API/app/application/task_types_repository.py new file mode 100644 index 0000000..77aaefe --- /dev/null +++ b/API/app/application/task_types_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.task_types import TaskType + + +class TaskTypesRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(TaskType).all() + + def get_by_id(self, task_type_id: int): + return self.db.query(TaskType).filter(TaskType.id == task_type_id).first() + + def create(self, task_type: TaskType): + self.db.add(task_type) + self.db.commit() + self.db.refresh(task_type) + return task_type + + def update(self, task_type: TaskType): + self.db.merge(task_type) + self.db.commit() + self.db.refresh(task_type) + return task_type + + def delete(self, task_type_id: int): + task_type = self.db.query(TaskType).filter(TaskType.id == task_type_id).first() + if task_type: + self.db.delete(task_type) + self.db.commit() + return task_type + + return None \ No newline at end of file diff --git a/API/app/application/test_answers_repository.py b/API/app/application/test_answers_repository.py new file mode 100644 index 0000000..3b7b864 --- /dev/null +++ b/API/app/application/test_answers_repository.py @@ -0,0 +1,35 @@ +from sqlalchemy.orm import Session + +from app.domain.models.test_answers import TestAnswer + + +class TestAnswersRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(TestAnswer).all() + + def get_by_id(self, test_answer_id: int): + return self.db.query(TestAnswer).filter(TestAnswer.id == test_answer_id).first() + + def create(self, test_answer: TestAnswer): + self.db.add(test_answer) + self.db.commit() + self.db.refresh(test_answer) + return test_answer + + def update(self, test_answer: TestAnswer): + self.db.merge(test_answer) + self.db.commit() + self.db.refresh(test_answer) + return test_answer + + def delete(self, test_answer_id: int): + test_answer = self.db.query(TestAnswer).filter(TestAnswer.id == test_answer_id).first() + if test_answer: + self.db.delete(test_answer) + self.db.commit() + return test_answer + + return None diff --git a/API/app/application/users_repository.py b/API/app/application/users_repository.py new file mode 100644 index 0000000..4f08e5a --- /dev/null +++ b/API/app/application/users_repository.py @@ -0,0 +1,38 @@ +from sqlalchemy.orm import Session + +from app.domain.models.users import User + + +class UsersRepository: + def __init__(self, db: Session): + self.db = db + + def get_all(self): + return self.db.query(User).all() + + def get_by_id(self, user_id: int): + return self.db.query(User).filter(User.id == user_id).first() + + def get_by_login(self, login: str): + return self.db.query(User).filter(User.login == login).first() + + def create(self, user: User): + self.db.add(user) + self.db.commit() + self.db.refresh(user) + return user + + def update(self, user: User): + self.db.merge(user) + self.db.commit() + self.db.refresh(user) + return user + + def delete(self, user_id: int): + user = self.db.query(User).filter(User.id == user_id).first() + if user: + self.db.delete(user) + self.db.commit() + return user + + return None diff --git a/API/app/domain/models/__init__.py b/API/app/domain/models/__init__.py index 3632877..e1de2a8 100644 --- a/API/app/domain/models/__init__.py +++ b/API/app/domain/models/__init__.py @@ -9,7 +9,7 @@ import app.domain.models.appeals_topics import app.domain.models.categories import app.domain.models.courses import app.domain.models.course_students -import app.domain.models.lectures +import app.domain.models.lecture import app.domain.models.lessons import app.domain.models.notification_types import app.domain.models.notifications diff --git a/API/app/domain/models/lectures.py b/API/app/domain/models/lecture.py similarity index 95% rename from API/app/domain/models/lectures.py rename to API/app/domain/models/lecture.py index 3f3bdcc..6b5d2e4 100644 --- a/API/app/domain/models/lectures.py +++ b/API/app/domain/models/lecture.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import relationship from app.domain.models import Base -class Lectures(Base): +class Lecture(Base): __tablename__ = 'lectures' id = Column(Integer, primary_key=True, autoincrement=True) diff --git a/API/app/domain/models/steps.py b/API/app/domain/models/steps.py index bffb177..9da10fa 100644 --- a/API/app/domain/models/steps.py +++ b/API/app/domain/models/steps.py @@ -16,5 +16,5 @@ class Step(Base): lesson = relationship('Lesson', back_populates='steps') type = relationship('StepType', back_populates='steps') - lectures = relationship('Lectures', back_populates='step') + lectures = relationship('Lecture', back_populates='step') tasks = relationship('StepTask', back_populates='step')