PolymorphicChildModelAdmin with show_in_index=False in Django Admin with nav_sidebar
Links to PolymorphicChildModelAdmin are as default (or with show_in_index=False) not shown on the index admin page. But in the newer Django Version there is also a sidebar which is shown per default, if you are in some modelsAdmin-Page. In that Sidebar the links to the PolymorphicChildModelAdmin are still shown, i think this is falsely. Or am i missing something?
Same here
Has anyone found a workaround for this ? I guess the list is pulled out from something like AdminSite._registry but not sure what could be the function to overwrite
@VietHo you can hide your model with has_module_permission:
@admin.register(Child1)
class Child1Admin(PolymorphicChildModelAdmin)
base_model=Child1
def has_module_permission(self, request):
return False