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

Filter relations by search_model_fields #224

Closed
christianramcke opened this issue Jan 4, 2023 · 8 comments · May be fixed by #232
Closed

Filter relations by search_model_fields #224

christianramcke opened this issue Jan 4, 2023 · 8 comments · May be fixed by #232
Labels
enhancement New feature or request Stale

Comments

@christianramcke
Copy link

christianramcke commented Jan 4, 2023

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

@arthurio
Copy link
Owner

I think it shouldn't be too hard 🤔 I'll kick off a PR 👍🏻

@mertcangokgoz
Copy link

Hi, @arthurio

When is this feature supposed to come? It's a very functional feature. ❤️

@arthurio
Copy link
Owner

@mertcangokgoz I have been busy, sorry for things slowing down a bit... I'll pick this up this week!

@mertcangokgoz
Copy link

@mertcangokgoz I have been busy, sorry for things slowing down a bit... I'll pick this up this week!

Any update @arthurio

@arthurio
Copy link
Owner

Before starting to work on the few "feature" PRs I had opened I started to restructure the documentation a notch #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.

Copy link

github-actions bot commented Jan 6, 2024

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.

@github-actions github-actions bot added the Stale label Jan 6, 2024
@arthurio arthurio removed the Stale label Jan 6, 2024
Copy link

github-actions bot commented Mar 7, 2024

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.

@github-actions github-actions bot added the Stale label Mar 7, 2024
@arthurio arthurio removed the Stale label Mar 7, 2024
Copy link

github-actions bot commented May 7, 2024

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.

@github-actions github-actions bot added the Stale label May 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants