當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。