API

common

resources

Base pages resources.

class pyramid_pages.resources.BasePageResource(node, prefix=None, request=None, parent=None, *args, **kwargs)[source]

Bases: object

Base resource tree class for pages.

View:view of resource.
Attr:The view machinery defaults to using the __call__ method of the view callable (or the function itself, if the view callable is a function) to obtain a response. The attr value allows you to vary the method attribute used to obtain the response. For example, if your view was a class, and the class has a method named index and you wanted to use this method instead of the class’s __call__ method to return the response, you’d say attr=”index” in the view configuration for the view. This is most useful when the view definition is a class.
Template:template for view of resource.
attr = 'page_with_redirect'
children
children_qty
get_prefix()[source]

Each resource defined in config for pages as dict. This method returns key from config where located current resource.

name
resource_of_node(node, parent=None)[source]
slug
template = 'pyramid_pages/index.jinja2'
view

alias of PageView

pyramid_pages.resources.models_of_config(config)[source]

Return list of models from all resources in config.

pyramid_pages.resources.resource_of_node(resources, node)[source]

Returns resource of node.

pyramid_pages.resources.resources_of_config(config)[source]

Returns all resources and models from config.

models

Models for page.

class pyramid_pages.models.BaseSacrudFlatPage[source]

Bases: pyramid_pages.models.SacrudOptions, pyramid_pages.models.SeoMixin, pyramid_pages.models.RedirectMixin, pyramid_pages.models.FlatPageMixin

Base flat page class for pyramid_sacrud.

class pyramid_pages.models.BaseSacrudMpttPage[source]

Bases: pyramid_pages.models.SacrudOptions, pyramid_pages.models.SeoMixin, pyramid_pages.models.RedirectMixin, pyramid_pages.models.MpttPageMixin

Base mptt page class for pyramid_sacrud.

class pyramid_pages.models.FlatPageMixin[source]

Bases: pyramid_pages.models.PageMixin

class pyramid_pages.models.MpttPageMixin[source]

Bases: sqlalchemy_mptt.mixins.BaseNestedSets, pyramid_pages.models.PageMixin

class pyramid_pages.models.PageMixin[source]

Bases: object

description = Column(None, UnicodeText(), table=None)
in_menu = Column(None, Boolean(), table=None)
name = Column(None, String(), table=None, nullable=False)
slug = Column(None, SlugType(), table=None, nullable=False)
visible = Column(None, Boolean(), table=None)
class pyramid_pages.models.RecursionPageMixin[source]

Bases: pyramid_pages.models.PageMixin

Model with single parent_id field

class pyramid_pages.models.RedirectMixin[source]

Bases: object

redirect
redirect_page
redirect_type = Column(None, ChoiceType(), table=None)
redirect_url = Column(None, String(), table=None)
class pyramid_pages.models.SacrudOptions[source]

Bases: object

sacrud_detail_col
class pyramid_pages.models.SeoMixin[source]

Bases: object

seo_description = Column(None, String(), table=None)
seo_keywords = Column(None, String(), table=None)
seo_metatags = Column(None, UnicodeText(), table=None)
seo_title = Column(None, String(), table=None)

routes

Routes for pyramid_pages

pyramid_pages.routes.add_globals(event)[source]
pyramid_pages.routes.home_page_factory(request)[source]
pyramid_pages.routes.includeme(config)[source]
pyramid_pages.routes.page_factory(request)[source]

Page factory.

Config models example:

models = {
    '': [WebPage, CatalogResource],
    'catalogue': CatalogResource,
    'news': NewsResource,
}
pyramid_pages.routes.register_views(*args)[source]

Registration view for each resource from config.

views

Views for pages

class pyramid_pages.views.PageView(context, request)[source]

Bases: object

page_with_redirect()[source]

security

Module contents

pyramid_pages.includeme(config)[source]
  Read the Docs
v: master  
Versions
latest
master
Free document hosting provided by Read the Docs.