Rendering a python dict in Jinja2 / Werkzeug

前端 未结 3 1417
梦谈多话
梦谈多话 2020-12-15 04:00

I\'m playing with a url shortener (basing it on the Shortly demo app from Werkzeug).

I have a dict like this -

    (\'1\', {\'target\': \'http://10.         


        
3条回答
  •  不思量自难忘°
    2020-12-15 04:35

    Please note that dict.items() method is exists in both Python 2 and Python 3. But the method gives no warranties about the order items contained in dictionary are being iterated. This is why it could make more sense for this example to use a list of dictionaries instead of a dictionary of dictionaries like you said above.

提交回复
热议问题