MyModel.objects.raw('sql语句')
返回RawQuerySet 集合对象
books = models.Book.objects.raw('select * from book') for book in books: print(book)
MyModel.objects.raw('sql语句')
返回RawQuerySet 集合对象
books = models.Book.objects.raw('select * from book') for book in books: print(book)