Beispiel #1
0
def addcomment(request):
    if request.POST:
        comment = Comments()
        comment.fname = request.POST.get('firstname')
        comment.name = request.POST.get('lastname')
        comment.lname = request.POST.get('secondname')
        comment.region_id = int(request.POST.get('region'))
        comment.city_id = int(request.POST.get('city'))
        comment.phone = request.POST.get('phone')
        comment.email = request.POST.get('email')
        comment.comment = request.POST.get('comment')
        comment.save()
        return HttpResponse(json.dumps(""))
    else:
        raise Http404