Working with Pyramid, my code looks like this:
class PageData:
@staticmethod
def create_data():
return [
{
'key_1A': 'info1A',
'key_2A': 'info2A',
'nested_list_A': [
{'nested_key1A': 'nested_val1A'},
{'nested_key2A': 'nested_val2A'},
],
},
{
'key_1A': 'info1B',
'key_2A': 'info2B',
'nested_list_B': [
{'nested_key1B': 'nested_val1B'},
{'nested_key2A': 'nested_val2A'},
],
},
]
And my html page code looks like this:
<span tal:condition="nested_key1A"> Open </span>
<span tal:condition="not nested_key1A"> Closed </span>
What is the proper syntax to reference nested_key? for a tal:condition statement?
In trying to figure this out I found my answer...
a becomes the assignment for nest_list_A eg b becomes the assignment for a.nested_list_A which will then access they key
if there is a value for the key, then tal:condition will continue as normal, otherwise it will skip while rendering.