Ejemplo n.º 1
0
def project_details(request, project_id):
    project = Project.objects.get(id=project_id)
    if request.method == 'POST':
        form = ProjectForm(request.POST)

        if form.is_valid():
            project.description = form
            project.save()
            return redirect('/project/{0}'.format(project.slug))

    return render(request,'project_management/project_details.html', {'project':project})
Ejemplo n.º 2
0
def addProject(request):
    
    if request.method == 'POST':
        form = ProjectForm(request.POST)

        if form.is_valid():
            project = form.save(commit=False)
            project.owner=request.user
            project.save()
            return redirect('/project/{0}'.format(project.slug))
        else:
            return redirect('/dashboard/')
    else:
        form = ProjectForm()

    return render(request, 'project_management/projectForm.html', {'form':form})