2 ms·
There's also a method (I forget the name, as I've never used it) where you write the full SQL and just tell Django which models' rows it's supposed to be return
by StavrosK 10y ago
There's also a method (I forget the name, as I've never used it) where you write the full SQL and just tell Django which models' rows it's supposed to be returning, and it will build model instances from the returned SQL. Pretty nifty.
- bebop 10y agoIt is the raw() function: https://docs.djangoproject.com/en/1.10/topics/db/sql/#passing-parameters-into-raw https://docs.djangoproject.com/en/1.10/topics/db/sql/#passin...