from django.shortcuts import render

# Create your views here.
from django.http import JsonResponse
from .models import RisingFreelancer
# Create your views here.

def rising(request):
    sellers = RisingFreelancer.objects.all()

    RisingFreelancerList = [];

    for s in sellers:
        if s.image:
            RisingFreelancerList.append({
                "name": s.name,
                "course": s.course,
                "batch": s.batch,
                "earning": s.earning,
                "image": request.build_absolute_uri(s.image.url),
                "video": s.video
            })
    return JsonResponse(RisingFreelancerList, safe=False)