for template: "Hi {{ name }}, whats your {{ age }}", I need dynamic fields as ['name', 'age']
Asked
Active
Viewed 40 times
0
-
Your question is how to pass the `name` and `age` to templates from flask function ? – Raja Simon May 30 '17 at 14:43
-
No, suppose I don't know what the template will be, how to pass correct context. – Rahul Mishra May 30 '17 at 14:46
-
Still not clear... Can you explain more about what do you want to achieve ? – Raja Simon May 30 '17 at 14:47
-
If you dont know the content of a template, how to get all dynamic fields, for example in the above example for template "Hi {{ name }}, whats your {{ age }}", dynamic fields are ['name', 'age']. Now if you want know, whats the content is, how to get the dynamic fields. – Rahul Mishra May 30 '17 at 14:53
-
Just saying, If you pass with dict then the hole process is very easy. – Raja Simon May 30 '17 at 14:57
-
But you can still get the items using `var.0` and so on... – Raja Simon May 30 '17 at 15:00