Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Django admin, how can I increase the width of the ManyToMany field's widget when using filter_horizontal?

In Django admin, how can I increase the width of the ManyToMany field's widget when using filter_horizontal?

like image 835
Mitch Avatar asked Feb 15 '10 22:02

Mitch


1 Answers

You could apply custom classes to the fields using ModelAdmin Fieldsets you wanted to change and add an extra stylesheet with:

class MyAdmin(admin.ModelAdmin):
    class Media:
        css = {
            "all": ("my_styles.css",)
        }

Otherwise you'll have to write your own admin templates or widgets.

like image 115
Gabriel Hurley Avatar answered Oct 13 '22 14:10

Gabriel Hurley