Re: Django: how to make queries between 2 tables that are not related in the model?

2020-02-13 Thread Mehul Anshumali
Connect one table with another table using foreign key and then in command prompt type python manage.py shell and then import your table in shell then write queries . On Thu, Feb 13, 2020, 2:59 PM Jérôme Le Carrou wrote: > Hi, > > I have 2 models that are not related (maybe it should...) > > I n

Re: Django: how to make queries between 2 tables that are not related in the model?

2020-02-13 Thread onlinejudge95
On Thu, Feb 13, 2020 at 2:59 PM Jérôme Le Carrou wrote: > Hi, > > I have 2 models that are not related (maybe it should...) > > I need to make a query that select all records of my table Stock WITH > related rows in Parametrage based on asp_sto_loc=asp_par_loc > > Something like SQL: select * fro

Re: Django: how to make queries between 2 tables that are not related in the model?

2020-02-13 Thread maninder singh Kumar
You of course mean, no foreign key ? Are the models pre written so no change can be made to them. Sent from my iPad > On 13-Feb-2020, at 2:58 PM, Jérôme Le Carrou wrote: > > Hi, > > I have 2 models that are not related (maybe it should...) > > I need to make a query that select all records of

Django: how to make queries between 2 tables that are not related in the model?

2020-02-13 Thread Jérôme Le Carrou
Hi, I have 2 models that are not related (maybe it should...) I need to make a query that select all records of my table Stock WITH related rows in Parametrage based on asp_sto_loc=asp_par_loc Something like SQL: select * from pha_asp_sto left join pha_asp_par on pha_asp_par.asp_par_loc=asp_st