I'm programming an application in Django and I have a ManyToManyField in my model, this relates a User model with Event model, but when I enter in django admin, the default form for ManyToManyField show all User registered in mi DB, I can't select the user that I want select.
¿ How I can change the default form in the admin site for a select form ?
This is what i have:
and I want something like this:
Thanks :)
You should use filter_horizontal in your Admin class for this model.
That would be something like:
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('participantes',)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.