[Python] Column with render_* method in django-tables2 not working

Discussão em 'Python' iniciado por Stack, Janeiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have a table defined like this using django-tables2:

    class MyTable(tables.Table):
    action = tables.Column()

    class Meta:
    model = User
    fields = ['name', 'email']

    def render_action(self, record):
    return 'Foo'


    But the render_action method is ignored and a -- is printed for every row instead. What am I missing?

    Continue reading...

Compartilhe esta Página