如何使用django视图保存字典中的多个字段?

时间:2016-12-09 06:00:15

标签: python django dictionary

我想使用django视图在字典中保存多个字段。

我的代码:

promotions = Promotions.objects.filter(member = request.user)
list11 = []
dictt = {}
d = []
i = 0
for q in promotions:
    c = customer_request.objects.filter(promotion = q)
    e = c.count()
    d.append(e)
    dictt[e] = e
    list11.append(c)
    print("counttttttttttttttt", dictt)

1 个答案:

答案 0 :(得分:0)

代码: img_name = {} img_name = {'名称':' xyz','键入':' jpg','路径':&# 39 /温度/' }