# HG changeset patch # User Nishanth Amuluru # Date 1294288558 -19800 # Node ID b592ed0b12b199cdfa01074a35ed54b4f8cee640 # Parent eeef395a4e02eb3d6e60a52eba365d9e92241a51 added a form in the template, for users to submit work diff -r eeef395a4e02 -r b592ed0b12b1 taskapp/views/task.py --- a/taskapp/views/task.py Thu Jan 06 00:17:53 2011 +0530 +++ b/taskapp/views/task.py Thu Jan 06 10:05:58 2011 +0530 @@ -3,7 +3,7 @@ from django.http import HttpResponse, Http404 from django.shortcuts import render_to_response, redirect -from pytask.taskapp.models import User, Task, Comment, Request, Notification +from pytask.taskapp.models import User, Task, Comment, Request, Notification, WorkReport from pytask.taskapp.utilities.task import getTask from pytask.taskapp.forms.task import TaskCreateForm, AddReviewerForm, AddTaskForm, ChoiceForm, AssignPyntForm, RemoveUserForm, EditTaskForm, ClaimTaskForm, WorkReportForm from pytask.taskapp.events.task import createTask, reqReviewer, publishTask, addSubTask, addDep, addClaim, assignTask, updateTask, removeTask, removeUser, assignPynts, completeTask, closeTask, addReviewer, deleteTask @@ -53,12 +53,13 @@ can_upload = True if user in task.assigned_users.all() else False - old_reports = WorkReport.workreport_report.all() + old_reports = task.workreport_report.all() context = { 'user': user, 'task': task, 'old_reports': old_reports, + 'can_upload': can_upload, } if request.method == "POST": diff -r eeef395a4e02 -r b592ed0b12b1 templates/task/report.html --- a/templates/task/report.html Thu Jan 06 00:17:53 2011 +0530 +++ b/templates/task/report.html Thu Jan 06 10:05:58 2011 +0530 @@ -10,6 +10,11 @@ {{rep.submitted_by}} | {{rep.attachment}}
{% endfor %} {% endif %} -some data
+{% if can_upload %} +Submit a report:
+
+{{ form.as_p }} +
+{% endif %} {% endblock %}