def post_comment_delete(request): response = reply_object() form = GenericForm(request.POST, request=request) if form.is_valid(): response = form.delete_comment() else: response["code"] = settings.APP_CODE["FORM ERROR"] response["errors"] = form.errors return HttpResponse(simplejson.dumps(response))
def delete_generic_object(request): response = reply_object() generic_form = GenericForm(request.POST) if generic_form.is_valid(): response = generic_form.delete_object() else: response["code"] = settings.APP_CODE["FORM ERROR"] response["errors"] = generic_form.errors return HttpResponse(simplejson.dumps(response))