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

Using controlled vocabularies in the admin list_filter #18

Open
majdal opened this issue Jan 9, 2023 · 0 comments
Open

Using controlled vocabularies in the admin list_filter #18

majdal opened this issue Jan 9, 2023 · 0 comments

Comments

@majdal
Copy link

majdal commented Jan 9, 2023

Hello!

I'm still using this package extensively in a project. For one of my models, I have a ControlledTermField, and I would like to filter against it in the admin using list_filter.

Current behaviour: If I add my ControlledTermField in my list_filter, all the controlled terms from all the vocabularies are listed in the filter, not just the ones from that specific field.

Desired behaviour: only the terms that belong to the vocabulary of the specified field should be displayed.

According to the Django docs, we can set a SimpleListFilter, and that works perfectly fine. I'm wondering two things:

  1. If there is a way to abstract the SimpleListFilter and include it in the package
  2. If abstraction would be too cumbersome/unnecessary, perhaps include a snippet in the docs to guide future users of the package.

Thanks again for the great work on the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant