I have two classes in a model .
One is Sdr_Layer class .
Other is a Test class .
Sdr_Layer has all these as attributes .
Layer_id
Layer_name
Layer_attribute_names
Test class is this
Sdr_Layer.Layer_id as the foreign key and also the primary key .
Layer_attribute_values
From one template , an user is allowed to search for all the types of Layers ( Test1 , Test2 , Test3 ) all are different tables .
Once he/she selects Test1 or Test2 or Test3 , its passed to this app that contains the model . A query is set to find out which one he/she choose ( Test1 , Test2 , Test3) . If the user has choosen Test1 , then the attributes are derived to be put into a form which is then mapped .
Where I am stuck is this , what should be the query set that gives me all the attribute_values if the user chooses Test1 .
Test1.objects.all() . This can be done , but it only serves the purpose if the user only chooses Test1 . What if the user chooses Test2 . Thus the problem . I hope I explained the problem
I don’t exactly understand what you are trying to do, but looks to me like, you need 1 base model so you can filter on a certain attribute of it.
should help. Having multiple DB tables wouldn’t help if you want to see all those in a given query.