Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolymorphicChildModelAdmin with show_in_index=False in Django Admin with nav_sidebar #497

Open
megges2000 opened this issue Sep 14, 2021 · 3 comments

Comments

@megges2000
Copy link

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?

@adamwojt
Copy link

adamwojt commented Dec 5, 2021

Same here

@VietHo
Copy link

VietHo commented Aug 11, 2022

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

@pauk-slon
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants