本文整理汇总了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