Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #17

Merged
merged 24 commits into from
Mar 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix view of foreign tree
  • Loading branch information
LuisLuii committed Mar 6, 2022
commit d0b295ae2ffdc023f0052d9aeff31c0c9d0e149b
12 changes: 8 additions & 4 deletions src/fastapi_quickcrud/misc/abstract_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,10 @@ async def async_get_one_with_foreign_tree(response: Response,
):
target_model = request.url.path.split("/")[-2]
join = query.__dict__.pop('join_foreign_table', None)
stmt = query_service.get_many_with_foreign_pk(query=query.__dict__, join_mode=join,
target_model=target_model)
stmt = query_service.get_one_with_foreign_pk(query=query.__dict__,
join_mode=join,
abstract_param=url_param.__dict__,
target_model=target_model)

query_result = await execute_service.async_execute(session, stmt)

Expand All @@ -785,8 +787,10 @@ def get_one_with_foreign_tree(response: Response,
target_model = request.url.path.split("/")[-2]
join = query.__dict__.pop('join_foreign_table', None)

stmt = query_service.get_one_with_foreign_pk(query=query.__dict__, join_mode=join,
target_model=target_model)
stmt = query_service.get_one_with_foreign_pk(query=query.__dict__,
join_mode=join,
abstract_param=url_param.__dict__,
target_model=target_model)
query_result = execute_service.execute(session, stmt)
parsed_response = parsing_service.find_one(response_model=response_model,
sql_execute_result=query_result,
Expand Down
2 changes: 1 addition & 1 deletion src/fastapi_quickcrud/misc/schema_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ def foreign_tree_get_one(self) -> Tuple:
path_model = [self.__db_model_table]
pk_list = [self.db_name + "." + self.primary_key_str]
total_table_of_foreign = {}
function_name = "get_many_by_pk_from"
function_name = "get_one_by_pk_from"

for relation in self.relation_level:
table_detail = self.foreign_mapper[relation]
Expand Down