Django sql raw query to queryset

25 views
Skip to first unread message

Suraj Thapa FC

unread,
Aug 23, 2019, 1:37:50 AM8/23/19
to django...@googlegroups.com
SELECT * 
FROM course_review_report LEFT JOIN courses ON course_review_report.cid = courses.cid


Can anyone pls write the querryset for the above sql query

Sipum

unread,
Aug 23, 2019, 2:28:41 AM8/23/19
to django...@googlegroups.com
You can use Queryset like -

course_review_report.objects.select_related('courses') 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPjsHcFbqD%2BgX1NA8QLYFsJUkb9VydzzcBRrNO2FpCyAgS0nqw%40mail.gmail.com.

Suraj Thapa FC

unread,
Aug 23, 2019, 2:57:11 AM8/23/19
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages