Open jdenisTLM opened 1 month ago
I solved this problem by attaching a querystring parameter to the url in the sidebar menu. So if you do something like:
"link": lambda url: f'{reverse_lazy("admin:my_model_add")}?always_inactive=true',
Might not be the best and long term way, but works for now.
I'm playing with custom urls to add a custom view to my ModelAdmin. This works, except one little thing.
Here is my context :
I've got an
ActivityAdmin
I've got a custom url, with
admin/activity/custom
url :This brings to this situation : when i navigate to
admin/activity/custom
, both menu items in sidebar are active (css color for active link) :That could sounds logic, because, when we enter on
admin/activity/add
for exemple, we have to keep the activity link active in the sidebar for the activity menu item.How can I do to have only my custom view active in the sidebar menu ?