def addproject(request): form = EditProjectForm(request.POST or None) if form.is_valid(): form.save() return redirect('frontend:manageprojects') return render(request, 'frontend/recruiter/addproject.html', { 'form': form})
def editproject(request, project_id): instance = get_object_or_404(Project, id=project_id) project = Project.objects.get(id=project_id) form = EditProjectForm(request.POST or None, instance=instance) if form.is_valid(): form.save() return redirect('frontend:manageprojects') return render(request, 'frontend/recruiter/editproject.html', {'project': project, 'form': form})