I would like to specify a css class to the fieldset (or parent divs) for the inlines specified in a ModelAdmin class, similar to what is specified for fieldsets. For example:
class Set2Inline(admin.TabularInline):
...
class MyModelAdmin(admin.ModelAdmin):
fieldsets = [
('Set1', {'fields': ['number', 'name', 'etc'], 'classes': ['toggle']})
]
inlines = [Set2Inline]
Is there a way to add a class in similar fashion to 'inlines', such as:
inlines = [
'Set2', {Set2Inline, 'classes': ['toggle']}
]
It doesn't matter if the class is attached to either the fieldset of the inline or its parent divs. What is important is to be able to specify a unique class for each inline in similar fashion to what is done for each fieldset. Is there a way to do this? If it can be done in the Set2Inline class that would be fine as well.
django/contrib/admin/templates/admin/edit_inline/tabular.html, then either set thetemplateattribute on yourSet2Inlineor define a new subclass ofInlineModelAdmin- I don't see anything in the standard templates that would allow this.