class ProjectsView(View):
def get(self, request, *args, **kwargs):
user = kwargs["user_id"]
user_account = UserAccount.objects.get(user=user)
customer = Customer.objects.get(useraccount=user_account)
projects = Project.objects.filter(customer=customer).values()
return JsonResponse(list(projects), safe=False)