def employerProfileView(request): user = getEmployerInfo() employer = Organization.objects.get(id=user) context = { 'employer' : employer } return render(request, "employer/profileview.html", context)
def editEmployerProfile(request): user = getEmployerInfo() edit_org = Organization.objects.get(id=user) edit_org.company_name = request.POST.get('name') edit_org.password = request.POST.get('password') edit_org.address = request.POST.get('address') edit_org.size = request.POST.get('size') edit_org.sector = request.POST.get('sector') edit_org.save() return redirect("profileView")
def createListing(request): status = request.POST.get("status") job_title = request.POST.get("job_title") city = request.POST.get("city") description = request.POST.get("description") organization = Organization.objects.get(id=getEmployerInfo()) contract_name = request.POST.get('contract') contract = Contract.objects.get(type=contract_name) createList = Listing(status=status, job_title=job_title, city=city, description = description, organization = organization, contract=contract) createList.save() return redirect('skills',createList.id)
def employerPageView(request): user = getEmployerInfo() print('USER: '******'\n') employer = Organization.objects.get(id=user) print('EMPLOYER: ', employer, '\n') listings = Listing.objects.filter(organization = employer) skills = ApplicantSkill.objects.all() context = { 'listings' : listings, 'skills' : skills, 'employer' : employer } return render(request, "employer/landing.html", context)
def editListing(request): listingid = request.POST.get('id') contract = request.POST.get('contract') contract = Contract.objects.get(type=contract) #contract = Contract.objects.get(id=listingid) organization = Organization.objects.get(id=getEmployerInfo()) editList = Listing.objects.get(id=listingid) editList.status = request.POST.get("status") editList.job_title = request.POST.get("job_title") editList.city = request.POST.get("city") editList.description = request.POST.get("description") editList.contract = contract editList.save() return redirect('skills',editList.id)