本文整理匯總了Python中django.contrib.admin.AdminSite.get_urls方法的典型用法代碼示例。如果您正苦於以下問題:Python AdminSite.get_urls方法的具體用法?Python AdminSite.get_urls怎麽用?Python AdminSite.get_urls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類django.contrib.admin.AdminSite
的用法示例。
在下文中一共展示了AdminSite.get_urls方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_urls
# 需要導入模塊: from django.contrib.admin import AdminSite [as 別名]
# 或者: from django.contrib.admin.AdminSite import get_urls [as 別名]
def get_urls(self):
from django.conf.urls.defaults import patterns, url, include
from obadmin.admin.urls import urlpatterns as local_urls
url_patterns = local_urls
url_patterns += AdminSite.get_urls(self)
return url_patterns
示例2: get_urls
# 需要導入模塊: from django.contrib.admin import AdminSite [as 別名]
# 或者: from django.contrib.admin.AdminSite import get_urls [as 別名]
def get_urls(self):
urlpatterns = DjangoAdminSite.get_urls(self)
urlpatterns += patterns('',
url(r'^confirm_script$', is_staff(ConfirmScriptView.as_view()), name='confirm_script'),
url(r'^run_script$', is_staff(RunScriptView.as_view()), name='run_script'),
url(r'^kill_script$', is_staff(KillScriptView.as_view()), name='kill_script')
)
return urlpatterns
示例3: get_urls
# 需要導入模塊: from django.contrib.admin import AdminSite [as 別名]
# 或者: from django.contrib.admin.AdminSite import get_urls [as 別名]
def get_urls(self):
"""
Add some extra URLs to the admin site, as per
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-views-to-admin-sites
"""
from obadmin.admin.urls import urlpatterns as local_urls
url_patterns = local_urls
url_patterns += AdminSite.get_urls(self)
return url_patterns