How to get edit url for model instance

28 Sep · by Tim Kamanin · 1 min read

Use this:

urlresolvers.reverse("admin:%s_%s_change" % (self.model._meta.app_label, self.model._meta.module_name), args=(object_id,))

to redirect to object edit page after performing some action, use this snippet:

return redirect(urlresolvers.reverse("admin:%s_%s_change" % (self.model._meta.app_label, self.model._meta.module_name), args=(object_id,)))

Comments

Required for comment verification