예제 #1
0
파일: views.py 프로젝트: kylemsguy/vhshop
def calibrate_face(request):
	if request.method == 'POST':
		form = FaceForm(request.POST, request.FILES)
		if form.is_valid():
			form.save()
			newform = FaceDataForm(instance=form.instance)
			return render(request, 'mainapp/calibrate.html', {'face': form.instance, 'image': form.instance.image.url})
		else:
			form = FaceDataForm(request.POST, request.FILES)
			return HttpResponse("Form is not valid")
예제 #2
0
파일: views.py 프로젝트: kylemsguy/vhshop
def upload_face(request):
	context = RequestContext(request)
	if request.method == 'POST':
		form = FaceForm(request.POST, request.FILES)
		if form.is_valid():
			# file is saved
			form.save()
			return render_to_response("calibrate.html", {'form': newform}, context)
	else:
		form = FaceForm()
	return render(request, 'mainapp/index.html')
예제 #3
0
def upload_face(request):
    context = RequestContext(request)
    if request.method == 'POST':
        form = FaceForm(request.POST, request.FILES)
        if form.is_valid():
            # file is saved
            form.save()
            return render_to_response("calibrate.html", {'form': newform},
                                      context)
    else:
        form = FaceForm()
    return render(request, 'mainapp/index.html')
예제 #4
0
def calibrate_face(request):
    if request.method == 'POST':
        form = FaceForm(request.POST, request.FILES)
        if form.is_valid():
            form.save()
            newform = FaceDataForm(instance=form.instance)
            return render(request, 'mainapp/calibrate.html', {
                'face': form.instance,
                'image': form.instance.image.url
            })
        else:
            form = FaceDataForm(request.POST, request.FILES)
            return HttpResponse("Form is not valid")
예제 #5
0
def get_face(request):
    """ May not be useful"""
    if request.method == 'POST':
        form = FaceForm(request.POST)
        if form.is_valid():
            my_method = form.save()
        else:
            form = FaceForm()

    return HttpResponse("Yay! Success!")
예제 #6
0
파일: views.py 프로젝트: kylemsguy/vhshop
def get_face(request):
	""" May not be useful"""
	if request.method == 'POST':
		form = FaceForm(request.POST)
		if form.is_valid():
			my_method = form.save()
		else:
			form = FaceForm()

	return HttpResponse("Yay! Success!")