Replies: 2 comments 4 replies
-
@lewoudar can you give an example |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @eadwinCode , @api_controller('/todos', tags=['todo'])
class TodoController(ControllerBase):
@route.get('/{todo_id}', response={200: TodoSchema})
def get_todo(self, todo_id: int):
# select related comments with the todo object
return self.get_object_or_exception(Todo, id=todo_id, prefecth_related=('comments',)) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From what I see in the documentation (actually this method is not really documented, I mainly look at the bookstore example demo), it is not possible to call methods select_related or prefetch_related.
This is a huge performance issue IMO, because we often want to fetch some related objects before using them in a template or JSON response.
Beta Was this translation helpful? Give feedback.
All reactions