add bound_blocks accessor to StructValue (so that code for rendering a StructValue can access the native renderers of the individual items, if they want)

This commit is contained in:
Matt Westcott 2015-01-20 11:44:35 +00:00
parent 81be94a34f
commit cec8bd32f1

View file

@ -417,6 +417,13 @@ class StructValue(collections.OrderedDict):
def __str__(self):
return self.block.render(self)
@cached_property
def bound_blocks(self):
return collections.OrderedDict([
(name, block.bind(self.get(name)))
for name, block in self.block.child_blocks.items()
])
class DeclarativeSubBlocksMetaclass(type):
"""