agateblue / django-dynamic-preferences

Dynamic global and instance settings for your django project
https://django-dynamic-preferences.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
348 stars 86 forks source link

Unregister dynamic preferences models from django admin #241

Closed willtrimz closed 2 years ago

willtrimz commented 3 years ago

I have created my own custom form page for updating my global preferences and have no need to view them within django's admin site and therefore would like to remove them from it to reduce clutter.

To unregister default django models such as Groups and Users, you can simply unregister them from within your admin.py file: `from django.contrib.auth.models import User

admin.site.unregister(Group)`

Is there a way to unregister global preferences from the admin page? As I have not been able to find out how thus far.

ondrejkolin commented 3 years ago

Have you tried inspecting the source code?

https://github.com/agateblue/django-dynamic-preferences/blob/4dd668f1b60523c6205b1df653501b8b7ca9023b/dynamic_preferences/admin.py#L77

I would just reverse what they register in the admin.py file. That should do the trick