Django学习Views.py
Posted Gtea
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Django学习Views.py相关的知识,希望对你有一定的参考价值。
from django.db.models import F, Q, Max, Min, Avg, Count from django.http import HttpResponse from django.shortcuts import render, redirect from polls.models import students from django.db import connection from django.db.models.query import QuerySet def getSql(res): if type(res) == QuerySet: sql = str(res.query) else: queries = connection.queries sql = str(queries[-1].get(‘sql‘), ‘utf-8‘) print(‘