You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from pyjade.parser import Parser`
from pyjade.ext.html import HTMLCompiler, local_context_manager
import pyjade
def process(jade_string, context=None, **compiler_kwargs):
ctx = context or {}
block = Parser(jade_string).parse()
compiler = HTMLCompiler(block, **compiler_kwargs)
with local_context_manager(compiler, ctx):
return compiler.compile()
jade_template = """p #{store} #{address.street}"""
json_data = {
"store":"MyBookStore",
"address": {"street": "Meryland","house": "5A"}
}
html = process(jade_template,json_data)
print html
It prints:
<p>MyBookStore None</p>
So it means it cannot access subfields of dictionaries, whereas jade should support that. It showed normally value of field "store", but not "store.address". Is it possible to fix this?
The text was updated successfully, but these errors were encountered:
I have a code below:
It prints:
So it means it cannot access subfields of dictionaries, whereas jade should support that. It showed normally value of field "store", but not "store.address". Is it possible to fix this?
The text was updated successfully, but these errors were encountered: