using app engine - yes i know all about django templates and other template engines.
Lets say i have a dictionary or a simple object, i dont know its structure and i
imagine we have this :{name: "a", children:[{name: "b", children: [] },{..},{..}]
def ConvertDictToUlLi():
jsonResult = GetSomeRecursiveDict()
def CreateHtml(DictItem, output):
output = "- "+DictItem["name"] if jsonResult.has_key("name") else " "
if len(DictItem["children"]) > 0:
output = output + "
"
for item in DictItem["children"]:
output = output + " "+CreateHtml(item, output)+" "
output = output + "
"
return output+" "
result = ""+CreateHtml(jsonResult, "")+"
"
return result