Reputation: 781
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 :)
Upvotes: 1
Views: 234
Reputation: 6343
You should use filter_horizontal in your Admin class for this model.
That would be something like:
class EventAdmin(admin.ModelAdmin):
filter_horizontal = ('participantes',)
Upvotes: 2