コード例 #1
0
ファイル: senateViews.py プロジェクト: himanshu-224/hms
def submit_policy(request, req):
	if request.user.is_authenticated() and request.user.get_profile().userType==5: 
		if request.POST['policy'] == "" or request.POST['policy'].isspace():
			return HttpResponseRedirect('/senate/createPolicy') 		
		elif req == "NPR":
			p = Policy(proposal = request.POST['policy'], status = "NPR", requestedTo = "DS")
			p.save()
			return render_to_response('senate/submitPolicy.html')
		elif req == "PFC":
			p = Policy(proposal = request.POST['policy'], status = "PFC", requestedTo = "DS")
			p.save()
			return render_to_response('senate/submitPolicy.html')	
		elif req == "PFD":
			p = Policy(proposal = request.POST['policy'], status = "PFD", requestedTo = "DS")
			p.save()
			return render_to_response('senate/submitPolicy.html')	
コード例 #2
0
ファイル: addPolicy.py プロジェクト: himanshu-224/hms
from mainapp.models import Policy

for i in range (1,5):	
	p=Policy(statement="s"+str(i), status="APP")
	p.save()

for i in range (6,10):	
	p=Policy(statement = "s"+str(i-4), proposal="p"+str(i), status="PFC", requestedTo="DS")
	p.save()

for i in range (11,14):	
	p=Policy(statement = "s"+str(i-4), proposal="p", status="PFC", requestedTo="SS")
	p.save()

for i in range (15,18):	
	p=Policy(proposal="n"+str(i), status="NPR", requestedTo="DS")
	p.save()

for i in range (18,20):	
	p=Policy(proposal="n"+str(i), status="NPR", requestedTo="SS")
	p.save()