Example #1
0
def project_charts(request):

    if request.method == 'POST':
        form = RangeQuery(request.POST)
        if form.is_valid():
            cleaned_data = form.cleaned_data
            begin_date = cleaned_data['begin_date']
            end_date = cleaned_data['end_date']
            userchart = projectchartdata(begin_date, end_date)
            c = {
                'users': list(User.objects.all()),
                'userchart': userchart,
                'form':form
            }

            return render_to_response('project_charts.html', c)
    else:
        form = RangeQuery()
        return render_to_response('project_charts.html',{'form':form})
Example #2
0
def user_project_chart(request, project_id):
    project = Project.objects.get(pk=project_id)
    if request.method == 'POST':
        form = RangeQuery(request.POST)
        if form.is_valid():
            cleaned_data = form.cleaned_data
            begin_date = cleaned_data['begin_date']
            end_date = cleaned_data['end_date']
            userchart = userchartdata(begin_date, end_date)
            c = {
                'users': list(project.project_members.all()),
                'userchart': userchart,
                'form':form
            }

            return render_to_response('user_charts.html', c)
    else:
        form = RangeQuery()
        return render_to_response('user_charts.html',{'form':form})