lundi 21 novembre 2016

django-tables2 CheckBoxColumn - only header checkbox is generated

I've got a table to generate based on a list of objects and I'd like to show one more column (checkboxcolumn) whose value would be set based on some data in my objects. I tried to use CheckBoxColumn shipped with django-tables2 but it only generates a checkbox in my header and all data rows display '- ' (minus sign with space). There is very little information about that particular column type on the Internet so I couldn't find any solution to this problem. Here is my code for the table:

class MyTable(ScheduleTable):
    checkbox_column = CheckBoxColumn()

    class Meta:
        order_by = "-end"

What I am missing? I tried adding some attributes (like td_input, input or checked parameter) but nothing worked.

Daniel




Aucun commentaire:

Enregistrer un commentaire