UPDATE
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
def render(obj, context):
|
||||
|
||||
if isinstance(obj, dict):
|
||||
return {k: render(v, context) for k, v in obj.items()}
|
||||
|
||||
if isinstance(obj, list):
|
||||
return [render(i, context) for i in obj]
|
||||
|
||||
if isinstance(obj, str):
|
||||
return obj.format(**context)
|
||||
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user