Skip to content

Commit ec046e3

Browse files
committed
add unit test for foreign tree
1 parent c44c8ef commit ec046e3

File tree

7 files changed

+801
-625
lines changed

7 files changed

+801
-625
lines changed

src/fastapi_quickcrud/m2m_test.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/fastapi_quickcrud/misc/abstract_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ async def async_get_many_with_foreign_tree(response: Response,
824824
):
825825
target_model = request.url.path.split("/")[-1]
826826
join = query.__dict__.pop('join_foreign_table', None)
827-
stmt = query_service.get_many(query=query.__dict__, join_mode=join, abstract_param=url_param,
827+
stmt = query_service.get_many(query=query.__dict__, join_mode=join, abstract_param=url_param.__dict__,
828828
target_model=target_model)
829829

830830
query_result = await execute_service.async_execute(session, stmt)

src/fastapi_quickcrud/misc/schema_builder.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,9 @@ def __foreign_mapper_builder(self):
198198
return foreign_mapper
199199

200200
def __get_table_name_from_table(self, table):
201-
if not hasattr(table, "name"):
202-
print("require name for your table if you try to query with foreign table")
203201
return table.name
204202

205203
def __get_table_name_from_model(self, table):
206-
if not hasattr(table, "name"):
207-
print("require __tablename__ for your model if you try to query with foreign table")
208204
return table.__tablename__
209205

210206
def __get_table_name(self, table):

0 commit comments

Comments
 (0)