如何获取django_tables2中的列列表

时间:2012-05-29 11:53:19

标签: django django-tables2

是否可以获取django_tables2表中的列列表

# tables.py
import django_tables2 as tables    

class MyTable(tables.Table):
    firstcol = tables.Column()
    secondcol = tables.Column()

然后使用函数......

 >>> MyTable.function_to_list_cols()
 ['firstcol', 'secondcol'] 

0 个答案:

没有答案
相关问题