Ejemplo n.º 1
0
 def get(self, request, *args, **kwargs):
     tool = Tools()
     datalist = tool.student_list_data(1)
     print(datalist)
     data = {
         "num": self.count,
         "datalist": datalist,
     }
     return render(request, "student.html", {
         "classesmsg": self.classesmsg,
         "pagename": self.pagename,
         "data": data
     })
Ejemplo n.º 2
0
 def post(self, request, *args, **kwargs):
     tool = Tools()
     num = request.POST.get("num")
     datalist = list(tool.student_list_data(num))
     print(datalist)
     # datalist = model_to_dict(data_list)
     # print(datalist)
     # datalist = serializers.serialize('json', datalist)
     data = {
         "classesmsg": self.classesmsg,
         "datalist": datalist,
     }
     data = json.dumps(data)
     print(data)
     return HttpResponse(data)