Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

flask pass an array of dicts

#python
def func1():
        data = filter() #returns a list of dictionaries

    return render_template("template1.html", data=data)

  
 #javascript
myvar = '{{data|tojson}}';
var parsed = JSON.parse(myvar);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flask #pass #array #dicts
ADD COMMENT
Topic
Name
4+8 =