Using Django 1.10, Python 3.5,
I have stored various information about the columns and tables I want to use to extract data in another table called smart_view
That smart_view
has the following columns:
- id (auto increment)
- name (varchar 255)
- columns (jsonb type)
- tables (jsonb type)
- conditions (jsonb type)
I want to dynamically select data columns from tables that may vary depending on the data stored in smart_view
table
I read about dynamically generate filters using an answer from https://stackoverflow.com/a/4720109/80353.
Is that applicable to my situation and how do I do the same for the tables (or Model) part?
UPDATE
The usual way of selecting specific values is
Entry.objects.values_list('id', 'headline')
As seen in https://docs.djangoproject.com/en/1.11/ref/models/querysets/#values-list
By dynamic, I meant you wouldn't know beforehand which model to extract the values from and which values they might be because they are stored as data in the table called smart_view