I'm using https://github.com/s-block/django-nested-inline with something like this:
class C(NestedStackedInline):
model = C
max_num = 1
fk_name = 'B'
class Media:
css = {
'all': ('/static/admin/css/forms-nested.css',)
}
class B(NestedStackedInline):
model = B
class Media:
css = {
'all': ('/static/admin/css/forms-nested2.css',)
}
inlines = [C]
class A(NestedModelAdmin):
model = A
inlines = [B]
forms-nested.css is:
.inline-related h3 {
margin: 0;
color: #666;
padding: 3px 5px;
font-size: 11px;
background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-bottom: 1px solid #ddd;
}
and forms-nested2.css is:
.inline-related h3 {
margin: 0;
color: #484846;
padding: 3px 5px;
font-size: 11px;
background: #D9DBCB;
border-bottom: 1px solid #ddd;
}
Essentially I'm trying to have model-specific CSS for nested inlines. I want class C (the 2nd level inline) to have different h3 styling to class B (the 1st level inline). However class C's Media seems to override class B.
Is there any way to do this ?
Thanks