How to search admin URL for custom model?
If I know the model, I can get the url by doing something like:
>>> print urlresolvers.reverse('admin:myapp_mymodel_change', args=(obj.id,)) /admin/myapp/mymodel/123/
I have a common foreign key on the model, and I would like to provide a link in admin to the corresponding page for changing the object. Since this can be any type of model, I cannot easily use reverse (). Is there a way that I could just do this as follows?
>>> get_admin_change_url(obj) /admin/myapp/mymodel/123/
Cerin source share