How to display url to objects from Many To Many relation instead standard widget?
For example url's to Author
objects here:
How to display url to objects from Many To Many relation instead standard widget?
For example url's to Author
objects here:
I think one way is to overwrite str method of Author.
Another is to change widget for that field Django: Admin: changing the widget of the field in Admin , my prefered method.
Django admin offers to properties that change the way m2m
fields act in the admin: filter_vertical
and filter_horizontal
use them like this:
class MyModelAdmin(admin.ModelAdmin):
filter_horizontal = ('author',)
or replace with filter_vertical
use one or the other on the same field.