Django admin filter_horizontal (& filter_vertical) not working

I am trying to use ModelAdmin.filter_horizontal and ModelAdmin.filter_vertical for the ManyToMany field instead of selecting multiple fields, but all I get is: 3385029.png

My model:

class Title(models.Model): #... production_companies = models.ManyToManyField(Company, verbose_name="-") #... 

My admin:

 class TitleAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("original_name",)} filter_horizontal = ("production_companies",) radio_fields = {"state": admin.HORIZONTAL} #... 

javascripts load OK, I really don't understand what is going on. Django Configuration 1.1.1.

+7
python django django-admin filtering
source share
1 answer

I finally got a solution. The problem was the verbose name of the field - it was str instead of unicode. Moving to Unicode helped.

Thanks: -)

+15
source share

All Articles