Skip to content

Instantly share code, notes, and snippets.

Avatar

Diego Magalhães DiegoMagg

View GitHub Profile
View gist:86dc63a235a97f8dbfc6a1ba4ae75f3f
from myapp.models import Mymodel
Mymodel.objects.filter(pk__in=[i.pk for i in Mymodel.objects.raw("SELECT * FROM mytable")])