templateを適切に指定したとき?
#cms_page ja
p = Page()
p.publisher_is_draft = True
p.publisher_public_id = None
p.publisher_state = 1
p.created_by = 'tosh'
p.changed_by = 'tosh'
p.parent_id = None
p.creation_date = datetime.datetime.now()
p.publication_date = datetime.datetime.now()
p.publication_end_date = None
p.in_navigation = True
p.soft_root = False
p.reverse_id = None
p.navigation_extenders = ''
p.published = True
p.template = 'body1Column.html'
p.site_id = 1
p.moderator_state = 1
p.level = 0
p.lft = 1
p.rght = 2
p.tree_id = 1
p.login_required = False
p.limit_visibility_in_menu = None
p.save()
#cms_title ja
tj = Title()
tj.publisher_is_draft = True
tj.publisher_public_id = None
tj.publisher_state = 1
tj.language = 'ja'
tj.title = 'トップページ'
tj.menu_title = ''
tj.slug = 'top-page'
tj.path = 'top-Page'
tj.has_url_overwrite = False
tj.application_urls = None
tj.redirect = None
tj.meta_description = None
tj.meta_keywords = None
tj.page_title = None
tj.page_id = 1
tj.creation_date = datetime.datetime.now()
tj.save()
#cms_title en
te = Title()
te.publisher_is_draft = True
te.publisher_public_id = None
te.publisher_state = 1
te.language = 'en'
te.title = 'Top Page'
te.menu_title = ''
te.slug = 'top-page-en'
te.path = 'top-page-en'
te.has_url_overwrite = False
te.application_urls = None
te.redirect = None
te.meta_description = None
te.meta_keywords = None
te.page_title = None
te.page_id = 1
te.creation_date = datetime.datetime.now()
te.save()
#plugins
#cms_cmsplugin (text) ja
plg = Text()
plg.publisher_is_draft = True
plg.publisher_public_id = None
plg.publisher_state = 1
plg.placeholder_id = 1
plg.parent_id = None
plg.position = 0
plg.language= 'ja'
plg.plugin_type = 'TextPlugin'
plg.creation_date = datetime.datetime.now()
plg.level = 0
plg.lft = 1
plg.rght= 2
plg.tree_id = 1
plg.body = '
トップページ
'
plg.save()
#cms_cmsplugin en
plg = Text()
plg.publisher_is_draft = True
plg.publisher_public_id = None
plg.publisher_state = 1
plg.placeholder_id = 1
plg.parent_id = None
plg.position = 0
plg.language= 'en'
plg.plugin_type = 'TextPlugin'
plg.creation_date = datetime.datetime.now()
plg.level = 0
plg.lft = 1
plg.rght= 2
plg.tree_id = 2
plg.body = '
Top Page
'
plg.save()
p.save()
0 件のコメント:
コメントを投稿