Django admin - how to store references to models in model field?
-
01-06-2021 - |
Question
I'm making some big changes in Django Admin and need to make an application to group various models to groups and then show it in menu. I have a function to generate list of all available admin models including permissions. So I make 1 model to add group (id, name). Via Inlines I want to add specific models to groups. What is the best way to store models references? Should I store it as string and during my menu is generated I should parse the name, find specific model and generate its url in admin?
Thanks for clues.
Solution
Sounds like contenttypes would help you.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow