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


Python Page.register_templates方法代码示例

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


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

示例1: setUp

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def setUp(self):
        Page.register_templates(
            {
                "key": "base",
                "title": "Standard template",
                "path": "feincms_base.html",
                "regions": (
                    ("main", "Main content area"),
                    ("sidebar", "Sidebar", "inherited"),
                ),
            }
        )
        self.site_1 = Site.objects.all()[0]

        # create a bunch of pages
        en = self.create_default_page_set(language="en")
        de = self.create_default_page_set(language="de", title="Testseite")
        de.translation_of = en
        de.save()
        de.parent.translation_of = en.parent
        de.parent.save()
        self.page_de = de.parent
        self.page_en = en.parent

        if hasattr(translation, "LANGUAGE_SESSION_KEY"):
            self.language_session_key = translation.LANGUAGE_SESSION_KEY
        else:
            # Django 1.6
            self.language_session_key = django_settings.LANGUAGE_COOKIE_NAME
开发者ID:feincms,项目名称:feincms,代码行数:31,代码来源:test_extensions.py

示例2: setUp

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def setUp(self):
        Page.register_templates({
            'key': 'base',
            'title': 'Standard template',
            'path': 'feincms_base.html',
            'regions': (
                ('main', 'Main content area'),
                ('sidebar', 'Sidebar', 'inherited'),
            ),
        })
        self.site_1 = Site.objects.all()[0]

        # create a bunch of pages
        en = self.create_default_page_set(language='en')
        de = self.create_default_page_set(language='de', title='Testseite')
        de.translation_of = en
        de.save()
        de.parent.translation_of = en.parent
        de.parent.save()
        self.page_de = de.parent
        self.page_en = en.parent

        if hasattr(translation, 'LANGUAGE_SESSION_KEY'):
            self.language_session_key = translation.LANGUAGE_SESSION_KEY
        else:
            # Django 1.6
            self.language_session_key = django_settings.LANGUAGE_COOKIE_NAME
开发者ID:ixc,项目名称:feincms,代码行数:29,代码来源:test_extensions.py

示例3: setUp

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def setUp(self):
        u = User(username="test", is_active=True, is_staff=True, is_superuser=True)
        u.set_password("test")
        u.save()

        Page.register_templates(
            {
                "key": "base",
                "title": "Standard template",
                "path": "feincms_base.html",
                "regions": (("main", "Main content area"), ("sidebar", "Sidebar", "inherited")),
            },
            {
                "key": "theother",
                "title": "This actually exists",
                "path": "base.html",
                "regions": (("main", "Main content area"), ("sidebar", "Sidebar", "inherited")),
            },
        )
开发者ID:nicoechaniz,项目名称:feincms,代码行数:21,代码来源:__init__.py

示例4: setUp

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def setUp(self):
        Page.register_templates({
            'key': 'base',
            'title': 'Standard template',
            'path': 'feincms_base.html',
            'regions': (
                ('main', 'Main content area'),
                ('sidebar', 'Sidebar', 'inherited'),
            ),
        })
        self.site_1 = Site.objects.all()[0]

        # create a bunch of pages
        en = self.create_default_page_set(language='en')
        de = self.create_default_page_set(language='de', title=u'Testseite')
        de.translation_of = en
        de.save()
        de.parent.translation_of = en.parent
        de.parent.save()
        self.page_de = de.parent
        self.page_en = en.parent
开发者ID:mjog,项目名称:feincms,代码行数:23,代码来源:test_extensions.py

示例5: setUp

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def setUp(self):
        u = User(username='test', is_active=True, is_staff=True, is_superuser=True)
        u.set_password('test')
        u.save()

        Page.register_templates({
                'key': 'base',
                'title': 'Standard template',
                'path': 'feincms_base.html',
                'regions': (
                    ('main', 'Main content area'),
                    ('sidebar', 'Sidebar', 'inherited'),
                    ),
                }, {
                'key': 'theother',
                'title': 'This actually exists',
                'path': 'base.html',
                'regions': (
                    ('main', 'Main content area'),
                    ('sidebar', 'Sidebar', 'inherited'),
                    ),
                })
开发者ID:aweakley,项目名称:feincms,代码行数:24,代码来源:base.py

示例6:

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
Page.register_templates({
    'title': _('Standard template'),
    'path': 'base.html',
    'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited')
        ),
    },{
        'title': _('Site map'),
        'path': 'sitemap.html',
        'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited'),
        ),
        },{
        'title': _('2 Column Layout'),
        'path': '2column.html',
        'regions': (
            ('column1', _('Column 1')),
            ('column2', _('Column 2')),
            ('sidebar', _('Sidebar'), 'inherited'),
        ),
        },{
        'title': _('Home Layout'),
        'path': 'home.html',
        'regions': (
            ('column1', _('Column 1')),
            ('column2', _('Column 2')),
            ('column3', _('Column 3')),
            ('column4', _('Column 4')),
            ('status1', _('Status 1')),
            ('status2', _('Status 2')),
        ),
        })
开发者ID:DylanBray,项目名称:BMIT,代码行数:36,代码来源:models.py

示例7: _

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
MEDIA_TYPE_CHOICES = (
    ('default', _('default')),
)

DIMENSION_CHOICES = (
    ('590x432', _('default')),
)

Page.register_templates({
    'title': 'Standard template',
    'path': 'page_default.html',
    'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited'),
        ('moodboard', _('Moodboard'), 'inherited'),
        ),
    },{
    'title': 'Homepage template',
    'path': 'page_home.html',
    'regions': (
        ('main', _('Main content area')),
        ('moodboard', _('Moodboard'), 'inherited'),
        ),
    })


class ArticleContentAdminForm(ItemEditorForm):
    def __init__(self, *args, **kwargs):
        super(ArticleContentAdminForm, self).__init__(*args, **kwargs)
        self.fields['text'].widget.attrs.update({'class': 'item-richtext'})

开发者ID:feincms,项目名称:feincms.org,代码行数:32,代码来源:models.py

示例8: render

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    def render(self, **kwargs):
        return render_to_string([
            'activity/plugin.html',
        ], {}, context_instance=kwargs.get('context'))


Page.register_extensions(
    'feincms.module.extensions.datepublisher',
    'feincms.module.extensions.translations'
)

Page.register_templates({
    'title': _('Standard template'),
    'path': 'base.html',
    'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited'),
        ('footer', _('Footer'), 'inherited'),
    ),
})

Page.register_templates({
    'title': _('Home map template'),
    'path': 'home_map.html',
    'regions': (
        ('main', _('Main content area')),
        ('sidebar', _('Sidebar'), 'inherited'),
        ('footer', _('Footer'), 'inherited'),
        ('welcome', _('Welcome message')),
    ),
})
开发者ID:596acres,项目名称:livinglots-philly,代码行数:33,代码来源:models.py

示例9: YouTubeParagraphEntry

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
from .forms import FeinCMSInline, MediaFileInline
from .utils import youtube_embed_url


jingo.env.install_gettext_translations(translation)

Page.register_templates(
    {
        'title': 'Content template',
        'path': 'content.html',
        'regions': (
            ('main', 'Main content area'),
            ('homepage', 'Homepage navigation'),
        ),
    },
    {
        'title': 'Home template',
        'path': 'home.html',
        'regions': (
            ('main', 'Main content area'),
        ),
    }
)


class YouTubeParagraphEntry(models.Model):
    feincms_item_editor_inline = FeinCMSInline
    title = models.CharField(max_length=255)
    subheader_2 = models.CharField(max_length=255, blank=True)
    subheader_3 = models.CharField(max_length=255, blank=True)
开发者ID:Osmose,项目名称:masterfirefoxos,代码行数:32,代码来源:models.py

示例10:

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
from news.models import New, LatestNews
from articles.models import ArticlesSlideshow
from players.models import Player
from schedule.models import Event
from gallery.models import GalleryContent, Gallery
from forms import MyContactForm


Page.register_templates(
    {
        "key": "base",
        "title": "Base Template",
        "path": "base.html",
        "regions": (("main", "Main region"), ("sidebar", "Sidebar", "inherited"), ("bottom", "Bottom", "inherited")),
    },
    {
        "key": "base_sitemap",
        "title": "Base Sitemap Template",
        "path": "base_sitemap.html",
        "regions": (("main", "Main region"), ("sidebar", "Sidebar", "inherited"), ("bottom", "Bottom", "inherited")),
    },
)
Page.create_content_type(RawContent, regions=("bottom"))
Page.create_content_type(RichTextContent)
Page.create_content_type(ImageContent, POSITION_CHOICES=(("default", "Default position"),))

Page.create_content_type(LatestNews)
Page.create_content_type(ArticlesSlideshow)
Page.create_content_type(GalleryContent)

开发者ID:olgabrani,项目名称:aw,代码行数:31,代码来源:models.py

示例11: get_admin_fields

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
from feincms.module.page.models import Page
from feincms.content.raw.models import RawContent
from feincms.content.image.models import ImageContent
from feincms.content.medialibrary.models import MediaFileContent
from feincms.content.application.models import ApplicationContent
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender
from feincms.content.application.models import reverse

from mptt.models import MPTTModel


Page.register_templates({
    'key': 'base',
    'title': 'Base Template',
    'path': 'base.html',
    'regions': (
        ('main', 'Main region'),
        ('sidebar', 'Sidebar', 'inherited'),
        ),
    })
Page.create_content_type(RawContent)
Page.create_content_type(MediaFileContent, TYPE_CHOICES=(
    ('default', 'Default position'),
    ))
Page.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


def get_admin_fields(form, *args, **kwargs):
    return {
开发者ID:mjog,项目名称:feincms,代码行数:33,代码来源:models.py

示例12:

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
Page.register_templates(
    {
        'title': _('Topic Page'),
        'path': 'page_layout_templates/topic_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('rich_text_content', _('Rich Text Content')),
            ('featured', _('Featured')),
            ('icon-featured-panes', _('Icon Featured Panes')),
            ('main_content', _('Main Content')),
            ('parallax_box', _('Parallax Box')),
            ('additional_content', _('Additional Content')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Detail Page'),
        'path': 'page_layout_templates/detail_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('rich-text-left-column', _('Left Column Text Block')),
            ('medium-image-right-column', _('Right Column Image')),
            ('featured', _('Featured')),
            ('main_content', _('Main Content')),
            ('call_to_action', _('Parallax Box')),
            ('additional_content', _('Additional Content')),
            ('rich-text-left-column-2', _('Left Column Text Block 2')),
            ('medium-image-right-column-2', _('Right Column Image 2')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Home Page'),
        'path': 'page_layout_templates/home_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('main_slider', _('Main Slider')),
            ('call_to_action', _('Call To Action Bar')),
            ('featured', _('Featured')),
            ('rich-text-left-column', _('Left Column Text Block')),
            ('medium-image-right-column', _('Right Column Image')),
            ('parallax_box_1', _('Parallax Box 1')),
            ('about', _('About')),
            ('parallax_box_2', _('Parallax Box 2')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Two-Column Content Page'),
        'path': 'page_layout_templates/simple_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('content', _('Two-Column Content')),
            ('call_to_action', _('Call To Action Bar')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Flickr Gallery Page'),
        'path': 'page_layout_templates/flickr_gallery.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('rich_text_content', _('Rich Text Block')),
            ('flickr_gallery', _('Flickr Gallery')),
            ('videos', _('Youtube Videos')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Rich Text Page'),
        'path': 'page_layout_templates/plain_text_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('rich_text_content', _('Content')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Video Gallery Page'),
        'path': 'page_layout_templates/video_gallery.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('content', _('Content')),
            ('video-column-1', _('Video Column 1')),
            ('video-column-2', _('Video Column 2')),
            ('video-column-3', _('Video Column 3')),
            ('additional_content', _('Additional Content')),
            ('sponsors', _('Sponsors')),
        )},
    {
        'title': _('Pricing Table Page'),
        'path': 'page_layout_templates/pricing_page.html',
        'regions': (
            ('header_block', _('Header Block')),
            ('title_banner', _('Title Banner')),
            ('rich_text_1', _('Rich Text Content 1')),
            ('pricing_table', _('Pricing Table')),
            ('rich_text_2', _('Rich Text Content 2')),
            ('sponsors', _('Sponsors')),
        )},
    {
#.........这里部分代码省略.........
开发者ID:AASHE,项目名称:aashe-conference,代码行数:103,代码来源:models.py

示例13:

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    'feincms.module.extensions.seo',                    # Search engine optimsation
    #'feincms.module.extensions.translations',          # Page translations
    'feincms.module.page.extensions.excerpt',           # Page summary
    'feincms.module.page.extensions.navigation',        # Navigation extensions
    'feincms.module.page.extensions.relatedpages',      # Links related content
    #'feincms.module.page.extensions.sites',            # Limit pages to sites
    'feincms.module.page.extensions.symlinks',          # Symlinked content extension
    'feincms.module.page.extensions.titles',            # Additional titles
)
Page.register_templates({
    'title': 'Standard page',
    'path': 'layouts/standard.html',
    'regions': (
        ('main', 'Main content area'),
    ),
}, {
    'title': 'Front page',
    'path': 'layouts/front_page.html',
    'regions': (
        ('vanity-links', 'Vanity links'),
        ('epic-hello', 'Epic hello'),
    ),
})
Page.create_content_type(RichTextContent)
Page.create_content_type(RawContent)
Page.create_content_type(MediaFileContent, TYPE_CHOICES=(
    ('default', 'default'),
))
Page.create_content_type(ApplicationContent, APPLICATIONS=(
    #('elephantblog', 'Blog', {'urls': 'elephantblog.urls'}),
    ('elephantblog.urls', 'Blog'),
))
开发者ID:hipikat,项目名称:hipikat.org,代码行数:34,代码来源:fein.py

示例14: _

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
    ('col2', _('Column two'))
)

Page.register_templates(
    {
        'key': 'base',
        'title': 'Base Template',
        'path': 'base.html',
        'regions': _basic_regions,
    },
    {
        'key': 'basesidebared',
        'title': 'Base Template With Sidebar',
        'path': 'baseSidebared.html',
        'regions': _basic_regions + _sidebar,
    },
    {
        'key': 'twoCols',
        'title': 'Two columns Template',
        'path': 'twoCols.html',
        'regions': _basic_regions + _twocols,
    },
    {
        'key': 'twoColsSidebared',
        'title': 'Two columns Template With Sidebar',
        'path': 'twoColsSidebared.html',
        'regions': _basic_regions + _twocols + _sidebar,
    })

Page.create_content_type(RichTextContent)
Page.create_content_type(MediaFileContent, TYPE_CHOICES=MEDIA_TYPE_CHOICES)
开发者ID:vencax,项目名称:vxk-cms,代码行数:33,代码来源:models.py

示例15:

# 需要导入模块: from feincms.module.page.models import Page [as 别名]
# 或者: from feincms.module.page.models.Page import register_templates [as 别名]
from sandbox_feincms.page_extensions import page_as_model
from feincms.module.page.models import Page
from feincms.content.richtext.models import RichTextContent

from django.db import models

Page.register_extensions(
    'datepublisher',
    'translations',
    'changedate',
    'navigation',
    'symlinks',
    'seo',
    page_as_model,
)

Page.register_templates({
    'key': 'content',
    'title': 'Content Page',
    'path': 'content.html',
    'regions': (
        ('main', 'Main Region'),
    ),
})

Page.create_content_type(RichTextContent, regions=('main',))
开发者ID:vkuzma,项目名称:asframework,代码行数:28,代码来源:models.py


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