示例#1
0
文件: views.py 项目: ArthurWu/e-leave
def maitenance(request):
	admins = main_utils.get_all_admins()
	leavetypes = main_utils.get_all_leave_types()
	departments = main_utils.get_all_departments()
	cycle = utils.read(utils.resfile(), 'Default', 'email.alert.cycle')
	return render_to_response('maitenance/maitenance.html',RequestContext(request, {
		'admins': admins, 
		'leavetypes': leavetypes,
		'departments': departments,
		'nav': 'settings',
		'cycle': cycle})
	)
示例#2
0
文件: views.py 项目: ArthurWu/e-leave
def add_department_view(request):
	from forms import DepartmentForm
	form = None
	if request.method == 'POST':
		form = DepartmentForm(request.POST)
		if form.is_valid():
			form.save()
	else:
		form = DepartmentForm()
		
	deps = main_utils.get_all_departments()
	
	from django.template import RequestContext

	return render_to_response('maitenance/department.html', RequestContext(request, {'form': form, 'deps': deps}))
示例#3
0
文件: views.py 项目: ArthurWu/e-leave
def deps_and_teams(request):
	departments = main_utils.get_all_departments()
	return render_to_response('maitenance/department.html', {
		'departments': departments
	})