使用django_tables2,当在页面上使用两个表时,会出现冲突,只有一个表会正确排序是否有解决方案?
class Table_class1(tables.Table):
uuid = tables.Column()
name1 = tables.Column()
class Meta:
pass
class Table_class2(tables.Table):
uuid = tables.Column()
name2 = tables.Column()
class Meta:
pass
staticmethod
def set_table(request, table_class1, table_lines):
table1 = table_class1(table_lines, prefix="1-")
RequestConfig(request).configure(table)
return table
staticmethod
def set_table(request, table_class2, table_lines):
table2 = table_class2(table_lines, prefix="2-")
RequestConfig(request).configure(table)
return table