Package web2py :: Package gluon :: Module template :: Class BlockNode

[hide private]
[frames] | no frames]

# Class BlockNode

source code

    object --+
             |
          Node --+
                 |
                BlockNode

Known Subclasses:
  Content

Block Container.

This Node can contain other Nodes and will render in a hierarchical order of when nodes were added.

ie:

       {{ block test }}
           This is default block test
       {{ end }}

Instance Methods | [hide private]

__init__(self, name=`'````'`, pre_extend=True, delimiters=`(``'``{{``'``,` `'``}}``'``)`) name - Name of this Node. | source code

__repr__(self) repr(x) | source code

__str__(self) Get this BlockNodes content, not including child Nodes | source code

append(self, node) Add an element to the nodes. | source code

extend(self, other) Extend the list of nodes with another BlockNode class. | source code

output(self, blocks) Merges all nodes into a single string. | source code

Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, name=`'````'`, pre_extend=True, delimiters=`(``'``{{``'``,` `'``}}``'``)`)
(Constructor)

source code

name - Name of this Node.

Overrides: Node.__init__

### __repr__(self)
(Representation operator)

source code

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __str__(self)
(Informal representation operator)

source code

Get this BlockNodes content, not including child Nodes

Overrides: Node.__str__

### append(self, node)

source code

    Add an element to the nodes.

    Keyword Arguments

    - node -- Node object or string to append.

### extend(self, other)

source code

    Extend the list of nodes with another BlockNode class.

    Keyword Arguments

    - other -- BlockNode or Content object to extend from.

### output(self, blocks)

source code

Merges all nodes into a single string.

blocks -- Dictionary of blocks that are extending from this template.