本文整理汇总了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
示例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
示例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")),
},
)
示例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
示例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'),
),
})
示例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')),
),
})
示例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'})
示例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')),
),
})
示例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)
示例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)
示例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 {
示例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')),
)},
{
#.........这里部分代码省略.........
示例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'),
))
示例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)
示例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',))