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


Python Entry.create_content_type方法代码示例

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


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

示例1: BlogEntriesNavigationExtension

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import create_content_type [as 别名]
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.

    It would be added to 'Blog' page properties in admin.
    """
    name = _('all blog entries')

    def children(self, page, **kwargs):
        for entry in Entry.objects.all():
开发者ID:mjog,项目名称:feincms,代码行数:32,代码来源:models.py

示例2: BlogEntriesNavigationExtension

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import create_content_type [as 别名]
            ),
    }

Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('blog_urls', 'Blog', {'admin_fields': get_admin_fields}),
    ('news.urls', 'News Application'),
    ('articles.urls', 'Articles Application'),
    ('players.urls', 'Players'),
    ('schedule.urls','Calendar')
    ))


Entry.register_regions(
    ('main', 'Main region'),
    )
Entry.create_content_type(RawContent, regions=(''))
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


class BlogEntriesNavigationExtension(NavigationExtension):
    """
    Extended navigation for blog entries.

    It would be added to 'Blog' page properties in admin.
    """
    name = _('all blog entries')

    def children(self, page, **kwargs):
        for entry in Entry.objects.all():
开发者ID:vinilios,项目名称:feincms-1,代码行数:33,代码来源:models.py

示例3: Category

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import create_content_type [as 别名]
Page.create_content_type(
    ApplicationContent,
    APPLICATIONS=(
        ("blog_urls", "Blog", {"admin_fields": get_admin_fields}),
        ("news.urls", "News Application"),
        ("articles.urls", "Articles Application"),
        ("players.urls", "Players"),
        ("schedule.urls", "Calendar"),
        ("gallery.urls", "Gallery New"),
    ),
)


Entry.register_regions(("main", "Main region"))
Entry.create_content_type(RawContent, regions=(""))
Entry.create_content_type(ImageContent, POSITION_CHOICES=(("default", "Default position"),))


Page.register_extensions("feincms.module.page.extensions.navigation", "feincms.module.page.extensions.sites")


class Category(MPTTModel):
    name = models.CharField(max_length=20)
    slug = models.SlugField()
    parent = models.ForeignKey("self", blank=True, null=True, related_name="children")

    class Meta:
        ordering = ["tree_id", "lft"]
        verbose_name = "category"
        verbose_name_plural = "categories"
开发者ID:olgabrani,项目名称:aw,代码行数:32,代码来源:models.py

示例4: _

# 需要导入模块: from feincms.module.blog.models import Entry [as 别名]
# 或者: from feincms.module.blog.models.Entry import create_content_type [as 别名]
        ('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:,项目名称:,代码行数:31,代码来源:


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