从django的两个模型中,我创建了一个字典列表,其中每个dictoronic是我在客户机中显示的表中的一行。你知道吗
我想能够排序为每个不同的“列”这个列表。你知道吗
objdict = []
mydict = {
'thing1': model1.val1,
'thing2': model2.val1,
'thing3': model2.val2,
'thing4': model1.val2,
'thing5': model1.val3,
}
objdict.append(mydict)
假设我想按升序排列这个列表。 我怎么能做到这一点?你知道吗
你应该能够做到:
会让你升序。对于降序:
相关问题 更多 >
编程相关推荐