filter_horizontal doesn't use full height when in collapsed fieldset
Say you have a field field
in model X
, which is a ManyToMany
field. You can use filter_horizontal
in the ModelAdmin
to display the available and selected options. However, if you use filter_horizontal
in combination with a fieldset which is collapsed by default, it won't take the full height.
Example:
@admin.register(X)
class XAdmin(admin.ModelAdmin):
list_display = ('a', 'b', 'c', 'field')
filter_horizontal = ('field',)
fieldsets = (
(None, {
'fields': ('a', 'b', 'c')
}),
('Other', {
'classes': ('collapse',),
'fields': ('field',)
})
)
which gets rendered as https://i.imgur.com/jZpUHYN.png
Change History
(10)
Type: |
Uncategorized → Bug
|
Triage Stage: |
Unreviewed → Accepted
|
Cc: |
Shubh Parmar added
|
Owner: |
changed from nobody to Shubh Parmar
|
Status: |
new → assigned
|
Has patch: |
set
|
Patch needs improvement: |
set
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Hi Peter — OK, thanks. If you'd like to look at an adjustment here, that would be great!