Django - Unprocessed SQL queries - what happens in a connection

I read that I can use raw SQL in Django and create Django for my models from the result .

However, I am wondering what will happen if I use joins in raw SQL. How does Django know which models to use?

(Are there any other issues I should know about?)

+5
source share
1 answer

These are not the compounds that matter, but the column names. You can, for example, do the following:

SELECT table.id, other_table.name AS name from table join other_table using (id)

table. Django other_table, table table. , , ...

, Django SQL . , , , , .

+4

All Articles