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


Python Entry.register_extensions方法代码示例

本文整理汇总了Python中feincms.module.blog.models.Entry.register_extensions方法的典型用法代码示例。如果您正苦于以下问题:Python Entry.register_extensions方法的具体用法?Python Entry.register_extensions怎么用?Python Entry.register_extensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在feincms.module.blog.models.Entry的用法示例。


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

示例1: _empty_reverse_cache

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import register_extensions [as 别名]
        page_de_1.applicationcontent_set.create(
            region='main', ordering=0,
            urlconf_path='feincms.tests.applicationcontent_urls')
        _empty_reverse_cache()

        settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),)
        self.client.get(page_de.get_absolute_url())
        self.assertEqual(reverse('feincms.tests.applicationcontent_urls/ac_module_root'),
                         page_de_1.get_absolute_url())

        self.client.get(page1.get_absolute_url())
        self.assertEqual(reverse('feincms.tests.applicationcontent_urls/ac_module_root'),
                      page.get_absolute_url())


Entry.register_extensions('seo', 'translations', 'seo')
class BlogTestCase(TestCase):
    def setUp(self):
        u = User(username='test', is_active=True, is_staff=True, is_superuser=True)
        u.set_password('test')
        u.save()

        Entry.register_regions(('main', 'Main region'), ('another', 'Another region'))
        Entry.prefilled_categories = prefilled_attribute('categories')
        Entry.prefilled_rawcontent_set = prefilled_attribute('rawcontent_set')

    def login(self):
        self.assertTrue(self.client.login(username='test', password='test'))

    def create_entry(self):
        entry = Entry.objects.create(
开发者ID:aweakley,项目名称:feincms,代码行数:33,代码来源:base.py

示例2: test_28_cached_url_clash

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import register_extensions [as 别名]
        self.assertEqual(u"".join(c.render() for c in page.content.main), "somethinggg")

    def test_28_cached_url_clash(self):
        self.create_default_page_set()

        page1 = Page.objects.get(pk=1)
        page2 = Page.objects.get(pk=2)

        page1.override_url = "/"
        page1.active = True
        page1.save()

        self.assertContains(self.create_pagecontent(page2, active=True, override_url="/"), "already taken by")


Entry.register_extensions("seo", "translations", "seo")


class BlogTestCase(TestCase):
    def setUp(self):
        u = User(username="test", is_active=True, is_staff=True, is_superuser=True)
        u.set_password("test")
        u.save()

        Entry.register_regions(("main", "Main region"), ("another", "Another region"))
        Entry.prefilled_categories = prefilled_attribute("categories")
        Entry.prefilled_rawcontent_set = prefilled_attribute("rawcontent_set")

    def login(self):
        assert self.client.login(username="test", password="test")
开发者ID:nicoechaniz,项目名称:feincms,代码行数:32,代码来源:__init__.py

示例3: BlogEntriesNavigationExtension

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import register_extensions [as 别名]
            label=capfirst(_('exclusive subpages')),
            required=False,
            initial=form.instance.parameters.get('exclusive_subpages', False),
            help_text=_('Exclude everything other than the application\'s content when rendering subpages.'),
            ),
    }


Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('testapp.blog_urls', 'Blog', {'admin_fields': get_admin_fields}),
    ('whatever', 'Test Urls', {'urls': 'testapp.applicationcontent_urls'}),
    ))

Entry.register_extensions(
    'feincms.module.extensions.seo',
    'feincms.module.extensions.translations',
    'feincms.module.extensions.seo',
    'feincms.module.extensions.ct_tracker',
    )
Entry.register_regions(
    ('main', 'Main region'),
    )
Entry.create_content_type(RawContent)
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


class BlogEntriesNavigationExtension(NavigationExtension):
    """
    Extended navigation for blog entries.
开发者ID:mjog,项目名称:feincms,代码行数:33,代码来源:models.py

示例4: _

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import register_extensions [as 别名]
    'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited'),
        ),
    })

Page.create_content_type(RichTextContent)
Page.create_content_type(ImageContent, POSITION_CHOICES=(
    ('block', _('block')),
    ('left', _('left')),
    ('right', _('right')),
    ))


# feincms blog stuff
Entry.register_extensions('translations') # Example set of extensions

Entry.register_templates({
    'title': _('Standard template'),
    'path': 'base.html',
    'regions': (
        ('main', _('Main content area')),
        ),
    })

Entry.create_content_type(RichTextContent)
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('block', _('block')),
    ('left', _('left')),
    ('right', _('right')),
    ))
开发者ID:,项目名称:,代码行数:33,代码来源:


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