我有一个看起来像这样的 dict 列表:
[set([u'meal', '0:08:35.882945']),
set([0, u'personal']),
set([0, u'sleep']),
set([0, u'transport']),
set([0, u'work'])]
我制作的:
[u'meal',u'personal', u'sleep', u'transport', u'work']
['0:08:35.882945', 0, 0, 0, 0]
使用此命令:
nob = [{m,n} for m,n in zip(cats,tot3)]
我怎样才能把它变成一个django-tables2表?
我试过这个:
# tables.py
class Small_table (tables.Table):
category = tables.Column(verbose_name="category")
class Meta:
attrs = {"class": "paleblue"}
# views.py
nt = Small_table(nob)
RequestConfig(request).configure(nt)
但是表格有一列破折号而不是我的数据,我应该改变什么?