I'm working on improving the admin.py in a django project, and while I'm not totally jazzed about how the table was coming out with three fields in the list_diplay, at least it's better than just getting a default object list with one column spanning the whole page...
Anyway, what I'm asking is why if this:
class FieldAdmin(admin.ModelAdmin):
list_display = ('name', 'label', 'standard', )
looks like this:
When I add a list_filter, like this:
class FieldAdmin(admin.ModelAdmin):
list_display = ('name', 'label', 'standard', )
list_filter = ['standard',]
Why does it look like this?
Is there a way to get the columns to re-grow to fill the width like it was prior to adding the filter? I've been reading the docs and googling, but it doesn't seem built in? The project I'm working on is currently using django 1,2,3,final.
FWIW, the css that causes this is here:
.change-list .filtered table, .change-list .filtered .paginator,
.filtered #toolbar, .filtered div.xfull {
margin-right: 160px !important;
width: auto !important;
}
disabling the width style specification fixes it, but I'd rather do things the django way if there is one - I was hoping maybe there's a way to customize the filter view from the FieldAdmin class?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…