I have three objects:
Thing
some fields
Bucket
things = models.ManyToManyField(Thing)
User
buckets = models.ManyToManyField(Bucket)
things = models.ManyToManyField(Thing)
When editing my "Bucket" field in the admin, I want to be able to select Things, but only those things that are in the "Things" list on the user currently logged in.
How can I do that? In other words, how can I filter the list of Things in the Bucket admin?
Thank you very much for your help in advance.
It is possible with django-selectable or django-autocomplete-light.
Read the docs:
There is a formfield_for_manytomany. Usage is similar to the answer given by defuz.