From 6329f9c06d95f37f99c15d2086b7cbb38b1a3ceb Mon Sep 17 00:00:00 2001 From: AlanSilvaaa Date: Tue, 26 May 2026 12:18:52 -0400 Subject: [PATCH] fix: move imports to local __init__.py files to make less noise on the routers --- app/problems/grade_1/__init__.py | 15 +++++++++++++++ app/routers/grade_1.py | 16 ++++------------ app/schemas/grade_1/__init__.py | 27 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/app/problems/grade_1/__init__.py b/app/problems/grade_1/__init__.py index e69de29..fe0c1c8 100644 --- a/app/problems/grade_1/__init__.py +++ b/app/problems/grade_1/__init__.py @@ -0,0 +1,15 @@ +from app.problems.grade_1.compose_and_decompose_numbers import ( + compose_and_decompose_numbers, +) +from app.problems.grade_1.join_pictures_with_quantity import ( + join_pictures_with_quantity, +) +from app.problems.grade_1.sum_with_image_reference import sum_with_image_reference +from app.problems.grade_1.where_are_more_items import where_are_more_items + +__all__ = [ + "compose_and_decompose_numbers", + "join_pictures_with_quantity", + "sum_with_image_reference", + "where_are_more_items", +] diff --git a/app/routers/grade_1.py b/app/routers/grade_1.py index 139817a..34ad5ae 100644 --- a/app/routers/grade_1.py +++ b/app/routers/grade_1.py @@ -1,26 +1,18 @@ from fastapi import APIRouter, HTTPException -from app.problems.grade_1.compose_and_decompose_numbers import ( +from app.problems.grade_1 import ( compose_and_decompose_numbers, -) -from app.problems.grade_1.join_pictures_with_quantity import ( join_pictures_with_quantity, + sum_with_image_reference, + where_are_more_items, ) -from app.problems.grade_1.sum_with_image_reference import sum_with_image_reference -from app.problems.grade_1.where_are_more_items import where_are_more_items -from app.schemas.grade_1.compose_and_decompose_numbers import ( +from app.schemas.grade_1 import ( ComposeAndDecomposeNumbersProblem, ComposeAndDecomposeNumbersRequest, -) -from app.schemas.grade_1.join_pictures_with_quantity import ( JoinPicturesWithQuantityProblem, JoinPicturesWithQuantityRequest, -) -from app.schemas.grade_1.sum_with_image_reference import ( SumWithImageReferenceProblem, SumWithImageReferenceRequest, -) -from app.schemas.grade_1.where_are_more_items import ( WhereAreMoreItemsProblem, WhereAreMoreItemsRequest, ) diff --git a/app/schemas/grade_1/__init__.py b/app/schemas/grade_1/__init__.py index e69de29..d6b89cd 100644 --- a/app/schemas/grade_1/__init__.py +++ b/app/schemas/grade_1/__init__.py @@ -0,0 +1,27 @@ +from app.schemas.grade_1.compose_and_decompose_numbers import ( + ComposeAndDecomposeNumbersProblem, + ComposeAndDecomposeNumbersRequest, +) +from app.schemas.grade_1.join_pictures_with_quantity import ( + JoinPicturesWithQuantityProblem, + JoinPicturesWithQuantityRequest, +) +from app.schemas.grade_1.sum_with_image_reference import ( + SumWithImageReferenceProblem, + SumWithImageReferenceRequest, +) +from app.schemas.grade_1.where_are_more_items import ( + WhereAreMoreItemsProblem, + WhereAreMoreItemsRequest, +) + +__all__ = [ + "ComposeAndDecomposeNumbersProblem", + "ComposeAndDecomposeNumbersRequest", + "JoinPicturesWithQuantityProblem", + "JoinPicturesWithQuantityRequest", + "SumWithImageReferenceProblem", + "SumWithImageReferenceRequest", + "WhereAreMoreItemsProblem", + "WhereAreMoreItemsRequest", +]