本文整理匯總了Python中config_models.views.ConfigurationModelCurrentAPIView.as_view方法的典型用法代碼示例。如果您正苦於以下問題:Python ConfigurationModelCurrentAPIView.as_view方法的具體用法?Python ConfigurationModelCurrentAPIView.as_view怎麽用?Python ConfigurationModelCurrentAPIView.as_view使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類config_models.views.ConfigurationModelCurrentAPIView
的用法示例。
在下文中一共展示了ConfigurationModelCurrentAPIView.as_view方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from config_models.views import ConfigurationModelCurrentAPIView [as 別名]
# 或者: from config_models.views.ConfigurationModelCurrentAPIView import as_view [as 別名]
def setUp(self):
super(ConfigurationModelAPITests, self).setUp()
self.factory = APIRequestFactory()
self.user = User.objects.create_user(
username='test_user',
email='[email protected]',
password='test_pass',
)
self.user.is_superuser = True
self.user.save()
self.current_view = ConfigurationModelCurrentAPIView.as_view(model=ExampleConfig)
# Disable caching while testing the API
patcher = patch('config_models.models.cache', Mock(get=Mock(return_value=None)))
patcher.start()
self.addCleanup(patcher.stop)
示例2: edX
# 需要導入模塊: from config_models.views import ConfigurationModelCurrentAPIView [as 別名]
# 或者: from config_models.views.ConfigurationModelCurrentAPIView import as_view [as 別名]
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
urlpatterns += (
url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
include('ccx.urls')),
)
# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
urlpatterns += (
url(r'^lti_provider/', include('lti_provider.urls')),
)
urlpatterns += (
url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
)
urlpatterns = patterns(*urlpatterns)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(
settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
)
# in debug mode, allow any template to be rendered (most useful for UX reference templates)
urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
示例3: url
# 需要導入模塊: from config_models.views import ConfigurationModelCurrentAPIView [as 別名]
# 或者: from config_models.views.ConfigurationModelCurrentAPIView import as_view [as 別名]
url(r"^update_example_certificate$", "certificates.views.update_example_certificate"),
url(r"^request_certificate$", "certificates.views.request_certificate"),
)
# XDomain proxy
urlpatterns += (url(r"^xdomain_proxy.html$", "cors_csrf.views.xdomain_proxy", name="xdomain_proxy"),)
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
urlpatterns += (url(r"^courses/{}/".format(settings.COURSE_ID_PATTERN), include("ccx.urls")),)
# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
urlpatterns += (url(r"^lti_provider/", include("lti_provider.urls")),)
urlpatterns += (url(r"config/self_paced", ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),)
urlpatterns = patterns(*urlpatterns)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(
settings.PROFILE_IMAGE_BACKEND["options"]["base_url"],
document_root=settings.PROFILE_IMAGE_BACKEND["options"]["location"],
)
# in debug mode, allow any template to be rendered (most useful for UX reference templates)
urlpatterns += (url(r"^template/(?P<template>.+)$", "debug.views.show_reference_template"),)
if "debug_toolbar" in settings.INSTALLED_APPS:
import debug_toolbar
示例4: edX
# 需要導入模塊: from config_models.views import ConfigurationModelCurrentAPIView [as 別名]
# 或者: from config_models.views.ConfigurationModelCurrentAPIView import as_view [as 別名]
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
urlpatterns += (
url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
include('ccx.urls')),
url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')),
)
# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
urlpatterns += (
url(r'^lti_provider/', include('lti_provider.urls')),
)
urlpatterns += (
url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)),
url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)),
url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)),
)
urlpatterns = patterns(*urlpatterns)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(
settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
)
示例5: edX
# 需要導入模塊: from config_models.views import ConfigurationModelCurrentAPIView [as 別名]
# 或者: from config_models.views.ConfigurationModelCurrentAPIView import as_view [as 別名]
# Custom courses on edX (CCX) URLs
if settings.FEATURES["CUSTOM_COURSES_EDX"]:
urlpatterns += (
url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN),
include('ccx.urls')),
)
# Access to courseware as an LTI provider
if settings.FEATURES.get("ENABLE_LTI_PROVIDER"):
urlpatterns += (
url(r'^lti_provider/', include('lti_provider.urls')),
)
urlpatterns += (
url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),
)
urlpatterns = patterns(*urlpatterns)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(
settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']
)
# in debug mode, allow any template to be rendered (most useful for UX reference templates)
urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
if 'debug_toolbar' in settings.INSTALLED_APPS: