Hello I'm am new to python and jinja templates and Java Script. I am
attempting to pass a nested dictionary via python to the jinja template.
Once in the template I want convert my python dictionary into a Java Script
object.
The error I am receiving is "identified or string literal or numeric
literal expected". Any help would be appreciated.
Source code in template::
function GetItemValue() {
let share= {{shares|safe}}; //identified or string literal or numeric
literal expected
Source code in python
share_data = {};
for shares in share.SHARES.getchildren():
thisid = shares.ID.text
# here I create the nested Dictionary for share details
data = {"MICR_Number":shares.MICR.text,
"UserCode":shares.TRCODE1.text,
"Current Max Courtesy Pay":shares.TRAMOUNT1.text,
"Original Choice of Courtesy Pay":shares.TRAMOUNT2.text}
share_data[thisid] = data
template = self.get_template("index.html", {'shares':share_data})
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pocoo-libs.
For more options, visit https://groups.google.com/d/optout.