class ApiIdc(View): def get(self,request,*args,**kwargs): pk = kwargs.get('pk') if pk: data = Idcc.objects.filter(id=pk) else: data = Idcc.objects.all() print(data) idcdata = data.values() print(idcdata) resdata = {'data':[s for s in idcdat
def get(self,request,*args,**kwargs):
pk = kwargs.get('pk')
if pk:
data = Idcc.objects.filter(id=pk)
else:
data = Idcc.objects.all()
print(data)
idcdata = data.values()
print(idcdata)
resdata = {'data':[s for s in idcdata]}
print(resdata)
return JsonResponse(resdata)