You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am developing a feature that requires filtering my relationships based on a specific column.
The relationship is such that 1 post can have N categories. When I am on my category page.
I want to select posts where the status is "published" and deleted_at is "None".
Describe the solution you'd like
I found this discussion #236 which helped me in resolving my issue.
Describe alternatives you've considered
I have also considered whether there is a way for the current model to know where the request is coming from when using get_list_query.
Additional context
I have overridden the get_list_query as follows:
The async def find_all method seems a bit complicated:
asyncdeffind_all(
self,
request: Request,
skip: int=0,
limit: int=100,
where: Union[Dict[str, Any], str, None] =None,
order_by: Optional[List[str]] =None,
) ->Sequence[Any]:
...
# The only line I need is to add the referer from request.headersstmt=self.get_list_query(request.headers.get('referer')).offset(skip)
... # rest of the original code
If it is possible to pass the request into the get_list_query method, then there might be no need to override the async def find_all method.
The text was updated successfully, but these errors were encountered:
whchi
changed the title
Enhancement: add "request" as parameter in the method get_list_query
Enhancement: add "request" as a parameter in the method get_list_query
Nov 6, 2023
Is your feature request related to a problem? Please describe.
I am developing a feature that requires filtering my relationships based on a specific column.
The relationship is such that 1 post can have N categories. When I am on my category page.
I want to select posts where the status is "published" and deleted_at is "None".
Describe the solution you'd like
I found this discussion #236 which helped me in resolving my issue.
Describe alternatives you've considered
I have also considered whether there is a way for the current model to know where the request is coming from when using
get_list_query
.Additional context
I have overridden the
get_list_query
as follows:The async def find_all method seems a bit complicated:
If it is possible to pass the request into the get_list_query method, then there might be no need to override the async def find_all method.
The text was updated successfully, but these errors were encountered: