def timeline(request, from_date, to_date, context_id):
try:
from_date_date = datetime.datetime(*time.strptime(from_date, '%Y_%m_%d')[0:5]).date()
to_date_date = datetime.datetime(*time.strptime(to_date, '%Y_%m_%d')[0:5]).date()
except ValueError:
raise Http404
context_id = int(context_id)
if context_id:
context_agent = get_object_or_404(EconomicAgent, pk=context_id)
timeline_date = datetime.date.today().strftime("%b %e %Y 00:00:00 GMT-0600")
unassigned = Commitment.objects.unfinished().filter(
from_agent=None,
event_type__relationship="work").order_by("due_date")
return render_to_response("valueaccounting/timeline.html", {
"orderId": 0,
"context_id": context_id,
"useContextId": 0,
"from_date": from_date,
"to_date": to_date,
"timeline_date": timeline_date,
"unassigned": unassigned,
}, context_instance=RequestContext(request))
评论列表
文章目录