2
裏面我admin.py
文件我有:反向模型管理的自定義網址
def get_urls(self):
urls = super(TextAdmin, self).get_urls()
my_urls = patterns('',
url(
r'customfunc1',
customfunc2,
name='customfunc23',
),
)
return my_urls + urls
這將使以下網址:
http://localhost:8000/admin/text/customfunc1
將執行功能customfunc2
。我現在的問題是如何通過執行reverse
來引用此URL?
我想:
reverse("admin:text_customfunc1")
reverse("admin:text_customfunc2")
reverse("admin:text_customfunc3")
reverse("text:customfunc1")
但這些都不工作。