当前位置: 首页>>代码示例>>Python>>正文


Python views.ConfigurationModelCurrentAPIView类代码示例

本文整理汇总了Python中config_models.views.ConfigurationModelCurrentAPIView的典型用法代码示例。如果您正苦于以下问题:Python ConfigurationModelCurrentAPIView类的具体用法?Python ConfigurationModelCurrentAPIView怎么用?Python ConfigurationModelCurrentAPIView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ConfigurationModelCurrentAPIView类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    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)
开发者ID:10clouds,项目名称:edx-platform,代码行数:17,代码来源:tests.py

示例2: edX

# 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'),
开发者ID:andela-tadesanya,项目名称:edx-platform,代码行数:29,代码来源:urls.py

示例3: url

    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
开发者ID:agaylard,项目名称:edx-platform,代码行数:31,代码来源:urls.py

示例4: edX

# 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']
    )
开发者ID:Stanford-Online,项目名称:edx-platform,代码行数:30,代码来源:urls.py

示例5: edX

# 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:
开发者ID:naihe138,项目名称:edx-platform,代码行数:30,代码来源:urls.py


注:本文中的config_models.views.ConfigurationModelCurrentAPIView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。