I have a model which contains ManyToMany relationship. But when I go to admin and want to add object from admin, the right pane where selection goes is not visible.
In order to select many to many fields and see them in a right pane, you should add filter_horizontal
to your admin class:
admin.py
class TheModelAdmin(admin.ModelAdmin):
filter_horizontal = ['the_name_of_the_field']
admin.site.register(TheModel, TheModelAdmin)
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.