Beispiel #1
0
def demouser_edit(request):
	demouser = DemoUser()

	form = DemoUserForm(request.POST, instance=demouser)

	if form.is_valid():
		demouser = form.save(commit=True)
		demouser.save()
		return redirect('ums:demouser_commit',demouser.id)

	return render_to_response('ums/demouser_edit.html',dict(form=form),context_instance=RequestContext(request))
Beispiel #2
0
def demouser_commit(request, demouser_id):
	demouser = get_object_or_404(DemoUser, pk=demouser_id)

	if request.method == 'POST':
		form = DemoUserForm(request.POST, instance=demouser)
		if form.is_valid():
			demouser = form.save(commit=True)
			demouser.save()
			return redirect('ums:demouser_fin',demouser.id)
	else:
		form = DemoUserForm(instance=demouser)

	return render_to_response('ums/demouser_commit.html',dict(form=form,demouser_id=demouser_id),context_instance=RequestContext(request))