我使用 django-tables2
:
class MyTable(tables.Table):
action = tables.Column()
class Meta:
model = User
fields = ['name', 'email']
def render_action(self, record):
return 'Foo'
但是render_action
方法被忽略,而A-则为每行打印。我想念什么?
我终于解决了它,将empty_values=()
添加到action
列属性。