I have a model where i store a key and a value like this:
class DataModel(models.Model):
key = models.CharField(max_length=128)
value = models.CharField(max_length=128)
The value in key is the name that i want to use as header or column name (in column defs) and the field value is the field that i want to display in the table.
How could i implement something like this? where should i start? Is there an example i can see?
In all the examples and implementations I have done before I always have to put the field name in column_defs. What I want now is to do it dynamically, since I don't know what value the field "key" will have..
First of all thank you for the great project :)
I have a model where i store a key and a value like this:
The value in key is the name that i want to use as header or column name (in column defs) and the field value is the field that i want to display in the table.
So the table should look like this:
|key1|key2|key3|key4| |value1|value2|value3|value4| |value1|value2|value3|value4| . . . . . . . .
How could i implement something like this? where should i start? Is there an example i can see?
In all the examples and implementations I have done before I always have to put the field name in column_defs. What I want now is to do it dynamically, since I don't know what value the field "key" will have..