Filter relations by search_model_fields
Is there a way to filter relation fields by search_model_fields in Filter.Constants?
For example:
class OrderFilter(Filter):
search: Optional[str]
order_id: Optional[int]
description: Optional[str]
address: Optional[AddressFilter] = FilterDepends(with_prefix("address", AddressFilter))
class Constants(Filter.Constants):
model = Order
search_field_name = "search"
search_model_fields = ["order_id", "description", "address.last_name"]
I want to add a field of the address relation in search_model_fields - address.last_name in this case.
I use SQLAlchemy as ORM.
Thank you alot for this fine piece of software <3
I think it shouldn't be too hard 🤔 I'll kick off a PR 👍🏻
Hi, @arthurio
When is this feature supposed to come? It's a very functional feature. ❤️
@mertcangokgoz I have been busy, sorry for things slowing down a bit... I'll pick this up this week!
@mertcangokgoz I have been busy, sorry for things slowing down a bit... I'll pick this up this week!
Any update @arthurio
Before starting to work on the few "feature" PRs I had opened I started to restructure the documentation a notch https://github.com/arthurio/fastapi-filter/pull/375. Unfortunately this is still in progress but I might go back to doing the features first in order to have a "clean" plate to take on pydantic v2 support.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.