Commit bbc750c9 by Sven Marnach

Rename table_definition field to content for nicer XML representation.

parent 28d5a460
...@@ -26,7 +26,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock): ...@@ -26,7 +26,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
scope=Scope.settings, scope=Scope.settings,
default='ActiveTable problem' default='ActiveTable problem'
) )
table_definition = String( content = String(
display_name='Table definition', display_name='Table definition',
help='The definition of the table in Python-like syntax.', help='The definition of the table in Python-like syntax.',
scope=Scope.content, scope=Scope.content,
...@@ -89,7 +89,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock): ...@@ -89,7 +89,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
editable_fields = [ editable_fields = [
'display_name', 'display_name',
'table_definition', 'content',
'help_text', 'help_text',
'column_widths', 'column_widths',
'row_heights', 'row_heights',
...@@ -126,8 +126,8 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock): ...@@ -126,8 +126,8 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
def parse_fields(self): def parse_fields(self):
"""Parse the user-provided fields into more processing-friendly structured data.""" """Parse the user-provided fields into more processing-friendly structured data."""
if self.table_definition: if self.content:
self.thead, self.tbody = parse_table(self.table_definition) self.thead, self.tbody = parse_table(self.content)
else: else:
self.thead = self.tbody = None self.thead = self.tbody = None
return return
...@@ -250,7 +250,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock): ...@@ -250,7 +250,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
"""Add a validation error.""" """Add a validation error."""
validation.add(ValidationMessage(ValidationMessage.ERROR, msg)) validation.add(ValidationMessage(ValidationMessage.ERROR, msg))
try: try:
thead, tbody = parse_table(data.table_definition) thead, tbody = parse_table(data.content)
except ParseError as exc: except ParseError as exc:
add_error('Problem with table definition: ' + exc.message) add_error('Problem with table definition: ' + exc.message)
thead = tbody = None thead = tbody = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment