2👍
✅
If you have Django 1.2+ you can use the raw()
method to return list of Model
instances using the results of a custom query. Something like this in your case:
query = "<your query goes here>"
Object.objects.raw(query)
Source:stackexchange.com