iommirocks / iommi

Your first pick for a django power cord
http://iommi.rocks
BSD 3-Clause "New" or "Revised" License
688 stars 47 forks source link

Admin: config for `all_models` from `iommi_admin.py` in apps don't apply #451

Open boxed opened 11 months ago

boxed commented 11 months ago

I tried adding

class Meta:
    # [...]
    parts__all_models__parts__extra = html.h1(
        'asdasd',
        after=0,
    )

but that conf never gets to Admin.all_models

boxed commented 11 months ago

Adding the conf on my Admin subclass doesn't seem to do it either...

boxed commented 11 months ago

The workaround I came up with:

class MyAdmin(Admin):
    # [....]
    extra = html.h1(
        'asdasd',
        after=0,
        include=lambda request, **_: request.get_full_path().endswith('/admin/'),
    )