Skip to content

Commit

Permalink
add option to use a value's html field generation method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephprince committed Jan 24, 2024
1 parent d5d6383 commit 41e9dba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hdmf/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,10 @@ def _generate_html_repr(self, fields, level=0, access_code="", is_field=False):
if isinstance(fields, dict):
for key, value in fields.items():
current_access_code = f"{access_code}.{key}" if is_field else f"{access_code}['{key}']"
html_repr += self._generate_field_html(key, value, level, current_access_code)
if hasattr(value, '_generate_field_html'):
html_repr += value._generate_field_html(key, value, level, current_access_code)
else:
html_repr += self._generate_field_html(key, value, level, current_access_code)
elif isinstance(fields, list):
for index, item in enumerate(fields):
access_code += f'[{index}]'
Expand Down

0 comments on commit 41e9dba

Please sign in to comment.