def UserJsonView(request): if request.method == 'GET': obj = user.User() response = obj.fetch_users(request) return JsonResponse(response.__dict__) if request.method == 'DELETE': response = user.User.delete_users(request) return JsonResponse(response.__dict__) if request.method == 'PUT': response = user.User.put_users(request) return JsonResponse(response.__dict__)
def get(self, request): obj = user.User() response = obj.fetch_users(request) return JsonResponse(response.__dict__)
def __init__(self, **kwargs): self.obj = user.User() super(UserJsonView, self).__init__(**kwargs)