From a90e71fd834fa29f550481b07116833ab816ed50 Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 22 Apr 2021 09:22:49 +0800 Subject: [PATCH] =?UTF-8?q?Update=2042.=E6=B7=B1=E5=85=A5=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Day41-55/42.深入模型.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Day41-55/42.深入模型.md b/Day41-55/42.深入模型.md index dc9b86b..4db909a 100644 --- a/Day41-55/42.深入模型.md +++ b/Day41-55/42.深入模型.md @@ -376,6 +376,8 @@ Teacher.objects.filter(subject__name__contains='全栈') def show_teachers(request): + try: + # 测试的时候要传参数‘sno’,如‘http://localhost:8000/teachers/?sno=1’ try: sno = int(request.GET.get('sno')) teachers = []