I want to filter my ManyToMany by related fields in the Django-Admin (create/edit object). For example i have 3 Models:
Model 1 - Boardgame: Name (CharField), Genre (ForeignKey) Model 2 - Location: Name (CharField), Boardgame (ManyToMany) Model 3 - Genre: Name (CharField)
Now in the django-admin when i edit a location i can add and remove boardgames via horizontal-filter. Now i want an extra select Field where i can define a genre, so the manyToMany choices change based on what i select on the genre-select.
But i can't find an option to
Anyone here having an idea, how to solve this?
What i tried so far:
Did you have a look at the django-formset package?
From reading your question, this example https://django-formset.fly.dev/dual-selector/#filtering-select-options shows what you're probably looking for.