4 ms·
https://docs.djangoproject.com/en/1.10/topics/db/sql/#django.db.models.Manager.raw https://docs.djangoproject.com/en/1.10/topics/db/sql/#django... you can alre
by metaphorm 10y ago
https://docs.djangoproject.com/en/1.10/topics/db/sql/#django.db.models.Manager.raw https://docs.djangoproject.com/en/1.10/topics/db/sql/#django...
you can already do this. the django ORM has a convenient and expressive API for a lot of very common types of queries, but lets you easily drop back into raw SQL when you have a high complexity query that you want to write by hand.
- jsmeaton 10y agoRaw requires a primary key to be returned so it can rebuild the model object for you. You could also use django.db.connection.cursor() directly.