Issue
I´m trying to find some example of how to use change url of modelAdmin and what exactly result it gives. Sincerly I do not understand the part from docs:
"This will find the first registered instance of the admin application (whatever the instance name), and resolve to the view for changing poll.Choice instances in that instance."
Solution
You can reverse with:
reverse('app:poll_choice_change', kwargs={'object_id': pk})
With app
the default namespace (you can specify a different one if you include this in the path(…)
where you attach the admin.urls
. poll
the name of the app, choice
the name of the model in lowercase, and pk
the primary key of the object.
Answered By - Willem Van Onsem
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.