i am using sqlite3 database in my python django application: i am defining my table structure which is similar to my actual table schema.
table1 having three column:
1. id | primary key | int
2. name | text
3. address | text
table2 having four column:
1. id | primary key | int
2. name_id | foreign key | int
3. name_info | text
4. address_info | text
table3 having four column:
1. id | primary key | int
2. name_id | foreign key | int
3. edu_info | text
4. busin_info | text
table4 having four column:
1. id | primary key | int
2. name_id | foreign key | int
3. progress_info | text
4. inventory_info | text
and so on ..
i want to access all table data with in single query in django on the basis of forgein key. its not necessary all tables having same no of record.
i have already set foreign key in all model. like :
class table(models.Model):
name = models.ForeignKey(modelname)