0

How to hide some of the models?

I need them registred to be used by other models, while calling via FK or nested etc.

I found one solution which is rather much about view layer of (MVC) http://blog.jholster.com/post/1534211028/hide-app-names-in-django-admin

I would like to set it in admin.py, that some of registred models are hidden.

andilabs
  • 22,159
  • 14
  • 114
  • 151

1 Answers1

2

If the models are in your application, just don't register them in the first place. If the model is in a third party app like the django.contrib.auth then use AdminSite unregister method. You can put this in any admin.py or urls.py important is to be discovered by the admin.autodiscover.

# admin.py
from django.contrib.auth.models import User

admin.site.unregister(User)
Bogdan Iulian Bursuc
  • 2,215
  • 1
  • 16
  • 19