标签:条件 nec res obj 示例 object success str query
示例代码如下:
from django.http import HttpResponse
from django.db import connection
from .models import Book
def index(request):
book = Book.objects.get(pk=3)
# 而不能是
# book = Book.objects.get(id__gte=3)
print(book)
print(connection.queries)
return HttpResponse("success!")
标签:条件 nec res obj 示例 object success str query
原文地址:https://www.cnblogs.com/guyan-2020/p/12271245.html