TabError:从模型中读取最后一个对象时,缩进中的制表符和空格使用不一致

2024-09-22 16:33:13 发布

您现在位置:Python中文网/ 问答频道 /正文

TabError:缩进中制表符和空格的使用不一致


class DownloadPDF(View):
    def get(self, request, *args, **kwargs):
        patientInfo.objects.all()
        # data.update({'Pregencies':pInfo.Pregencies,'Glucose':Glucose,'BloodPressure':BloodPressure,'SkinThickness':SkinThickness,'Insulin':Insulin,'BMI':BMI,'DiabetesPedigreeFunction':DiabetesPedigreeFunction,'Age':Age,'username':request.user,'result':predict})
        pdf = render_to_pdf('accounts/pdf_template.html', data)
        response = HttpResponse(pdf, content_type='application/pdf')
        filename = "Invoice_%s.pdf" %("12341231")
        content = "attachment; filename='%s'" %(filename)
        response['Content-Disposition'] = content
        return response

Tags: agedatapdfresponserequestcontentfilenamebmi