pyams_template
package ⊞¶
PyAMS_template package
PyAMS templates management
Subpackages¶
pyams_template.metaconfigure
¶
PyAMS_template.metadirectives module
Is module allows to handle <template /> and <layout > directives in ZCML files.
-
pyams_template.metaconfigure.
layout_template_directive
(_context, template, name='', for_=<InterfaceClass zope.interface.Interface>, layer=<InterfaceClass pyramid.interfaces.IRequest>, provides=<InterfaceClass pyams_template.interfaces.ILayoutTemplate>, content_type='text/html', macro=None, context=None)[source]¶ ZCML <layout /> directive handler
-
pyams_template.metaconfigure.
template_directive
(_context, template, name='', for_=<InterfaceClass zope.interface.Interface>, layer=<InterfaceClass pyramid.interfaces.IRequest>, provides=<InterfaceClass pyams_template.interfaces.IContentTemplate>, content_type='text/html', macro=None, context=None)[source]¶ ZCML <template /> directive handler
pyams_template.metadirectives
¶
PyAMS_template.metadirectives module
This module provides ZCML directives interfaces
-
interface
pyams_template.metadirectives.
ILayoutTemplateDirective
[source]¶ Extends:
pyams_template.metadirectives.ITemplateDirective
Parameters for the layout template directive.
-
provides
¶ Interface the template provides
This attribute specifies the interface the template instance will provide.
Implementation: zope.configuration.fields.GlobalInterface
Read Only: False Required: False Default Value: <InterfaceClass pyams_template.interfaces.ILayoutTemplate> Value Type
Implementation: zope.schema.InterfaceField
Read Only: False Required: True Default Value: None
-
-
interface
pyams_template.metadirectives.
ITemplateDirective
[source]¶ Parameters for the template directive.
-
template
¶ Layout template.
Refers to a file containing a page template (should end in extension
.pt
or.html
).Implementation: zope.configuration.fields.Path
Read Only: False Required: True Default Value: None Allowed Type: str
-
name
¶ The name of the template.
The name is used to look up the template.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: ‘’ Allowed Type: str
-
macro
¶ Macro
The macro to be used. This allows us to define different macros in one template. The template designer can now create a whole site, the ViewTemplate can then extract the macros for single viewlets or views. If no macro is given the whole template is used for rendering.
Implementation: zope.schema.TextLine
Read Only: False Required: False Default Value: ‘’ Allowed Type: str
-
for_
¶ View
The view for which the template should be available
Implementation: zope.configuration.fields.GlobalObject
Read Only: False Required: False Default Value: <InterfaceClass zope.interface.Interface>
-
layer
¶ Layer
The layer for which the template should be available
Implementation: zope.configuration.fields.GlobalObject
Read Only: False Required: False Default Value: <InterfaceClass pyramid.interfaces.IRequest>
-
context
¶ Context
The context for which the template should be available
Implementation: zope.configuration.fields.GlobalObject
Read Only: False Required: False Default Value: None
-
provides
¶ Interface the template provides
This attribute specifies the interface the template instance will provide.
Implementation: zope.configuration.fields.GlobalInterface
Read Only: False Required: False Default Value: <InterfaceClass pyams_template.interfaces.IContentTemplate> Value Type
Implementation: zope.schema.InterfaceField
Read Only: False Required: True Default Value: None
-
content_type
¶ Content Type
The content type identifies the type of data.
Implementation: zope.schema.ASCIILine
Read Only: False Required: False Default Value: ‘text/html’ Allowed Type: str
-
pyams_template.template
¶
PyAMS_template.template module
This module provides Pyramid decorators which can be used to register a Chameleon template for a given view.
These templates are registered as multi-adapters, for a view and a request, so they can be replaced or overriden easilly.
-
class
pyams_template.template.
BoundViewTemplate
(tmpl, obj)[source]¶ Bases:
object
Bound view template
-
im_func
¶ im_func property
-
im_self
¶ im_self property
-
-
class
pyams_template.template.
GetContentTemplate
(name='')[source]¶ Bases:
pyams_template.template.ViewTemplate
Page template getter class
-
class
pyams_template.template.
GetLayoutTemplate
(name='')[source]¶ Bases:
pyams_template.template.ViewTemplate
Layout template getter class
-
class
pyams_template.template.
TemplateFactory
(filename, content_type, macro=None)[source]¶ Bases:
object
Base template factory
-
template
= None¶
-
-
class
pyams_template.template.
ViewTemplate
(provides=<InterfaceClass pyams_template.interfaces.IPageTemplate>, name='')[source]¶ Bases:
object
View template class
-
pyams_template.template.
get_content_template
¶
-
pyams_template.template.
get_layout_template
¶
-
pyams_template.template.
get_view_template
¶ alias of
pyams_template.template.ViewTemplate
-
class
pyams_template.template.
layout_config
(**settings)[source]¶ Bases:
object
Class decorator used to declare a layout template
-
venusian
= <module 'venusian' from '/home/docs/checkouts/readthedocs.org/user_builds/pyams/envs/latest/lib/python3.7/site-packages/venusian/__init__.py'>¶
-
-
pyams_template.template.
override_layout
(view, **settings)[source]¶ Override layout template for a given class
This function can be used to override a class layout template without using ZCML. Settings are the same as for @layout_config decorator.