From c99bada915d4e5792eed66ba212fa7c61c21083a Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 20 Jan 2015 10:59:09 +0000 Subject: [PATCH] rename RenderableStructBlock to StructValue for consistency with StreamValue, and to indicate that it's the core value type handled by StreamBlock, not just a special case for rendering --- wagtail/wagtailadmin/blocks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wagtail/wagtailadmin/blocks.py b/wagtail/wagtailadmin/blocks.py index d6a6e8ad7..155e92b50 100644 --- a/wagtail/wagtailadmin/blocks.py +++ b/wagtail/wagtailadmin/blocks.py @@ -386,8 +386,8 @@ class BaseStructBlock(Block): return result def to_python(self, value): - # recursively call to_python on children and return as a RenderableStructBlock - return RenderableStructBlock(self, [ + # recursively call to_python on children and return as a StructValue + return StructValue(self, [ (name, self.child_blocks[name].to_python(val)) for name, val in value.items() ]) @@ -403,9 +403,9 @@ class BaseStructBlock(Block): return render_to_string(self.template, {'self': value}) @python_2_unicode_compatible # ensures that the output of __str__ doesn't lose its 'safe' flag -class RenderableStructBlock(dict): +class StructValue(dict): def __init__(self, block, *args): - super(RenderableStructBlock, self).__init__(*args) + super(StructValue, self).__init__(*args) self.block = block def __str__(self):