I'd like to use django-tables2 to display data from a spreadsheet or csv file. The data will always be dynamic so I need a way of dynamically adding columns to my django-tables2 table. From the documentation there seems to be no way of doing this.
Any ideas?
In Python, you can use type to construct classes dynamically.
Let's use the example from the docs, which defines a table with one column,
name
.This could be defined dynamically with
The data in your spreadsheet will be more complicated, but the same approach should work.