示例#1
0
def create_time(request, customerID, projectID):
	proj = Project.objects.get(pk=projectID)
	date = request.POST['date']
	num_hours = request.POST['num_hours']
	t = BilledTime(date = date, num_hours = num_hours, project = proj)
	t.save()
	return priv_site_views.project(request, customerID, projectID)
示例#2
0
def set_times(request):

	try:
		times = json.loads(request.POST['time_list'])
	except:
		print 'Exception', sys.exc_info()[0]
		raise
	for time in times:
		proj = Project.objects.get(pk = time['project'])
		new_time = BilledTime(date = time['date'], project = proj, num_hours = time['num_hours'])
		print new_time
		try:
			new_time.save()
		except:
			print 'Save Exception', sys.exc_info()[0]
			raise
	return True