from django.shortcuts import render, HttpResponse
from rest_framework.views import APIView, status
from ..jsonparser.college_review_json import CollegeReviewJsonParser
from ..college_review_services import CollegeReviewORM
import json
__author__ = 'ravi'


class AddCollegeReview(APIView):

    def post(self, request):
        if request.method == "POST":
            response = dict()
            try:
                college_review_helper = CollegeReviewJsonParser.college_review_json_parser(request.POST.get('jsonData'))
                CollegeReviewORM.save_college_review(college_review_helper)
                response.update({'message': "date saved successfully"})
                response.update({'response_code': status.HTTP_200_OK})
                response.update({'status': 'success'})
            except Exception as ex:
                response.update({'message': 'could not save data'})
                response.update({'response_code': status.HTTP_406_NOT_ACCEPTABLE})
                response.update({'status': 'error'})

            return HttpResponse(json.dumps(response), content_type="application/json")
42e0867e30ca7cd0aea62a4a4d6a07b3b70069a5
<mask token>


class AddCollegeReview(APIView):
    <mask token>

<mask token>


class AddCollegeReview(APIView):

    def post(self, request):
        if request.method == 'POST':
            response = dict()
            try:
                college_review_helper = (CollegeReviewJsonParser.
                    college_review_json_parser(request.POST.get('jsonData')))
                CollegeReviewORM.save_college_review(college_review_helper)
                response.update({'message': 'date saved successfully'})
                response.update({'response_code': status.HTTP_200_OK})
                response.update({'status': 'success'})
            except Exception as ex:
                response.update({'message': 'could not save data'})
                response.update({'response_code': status.
                    HTTP_406_NOT_ACCEPTABLE})
                response.update({'status': 'error'})
            return HttpResponse(json.dumps(response), content_type=
                'application/json')

<mask token>
__author__ = 'ravi'


class AddCollegeReview(APIView):

    def post(self, request):
        if request.method == 'POST':
            response = dict()
            try:
                college_review_helper = (CollegeReviewJsonParser.
                    college_review_json_parser(request.POST.get('jsonData')))
                CollegeReviewORM.save_college_review(college_review_helper)
                response.update({'message': 'date saved successfully'})
                response.update({'response_code': status.HTTP_200_OK})
                response.update({'status': 'success'})
            except Exception as ex:
                response.update({'message': 'could not save data'})
                response.update({'response_code': status.
                    HTTP_406_NOT_ACCEPTABLE})
                response.update({'status': 'error'})
            return HttpResponse(json.dumps(response), content_type=
                'application/json')

from django.shortcuts import render, HttpResponse
from rest_framework.views import APIView, status
from ..jsonparser.college_review_json import CollegeReviewJsonParser
from ..college_review_services import CollegeReviewORM
import json
__author__ = 'ravi'


class AddCollegeReview(APIView):

    def post(self, request):
        if request.method == 'POST':
            response = dict()
            try:
                college_review_helper = (CollegeReviewJsonParser.
                    college_review_json_parser(request.POST.get('jsonData')))
                CollegeReviewORM.save_college_review(college_review_helper)
                response.update({'message': 'date saved successfully'})
                response.update({'response_code': status.HTTP_200_OK})
                response.update({'status': 'success'})
            except Exception as ex:
                response.update({'message': 'could not save data'})
                response.update({'response_code': status.
                    HTTP_406_NOT_ACCEPTABLE})
                response.update({'status': 'error'})
            return HttpResponse(json.dumps(response), content_type=
                'application/json')

from django.shortcuts import render, HttpResponse
from rest_framework.views import APIView, status
from ..jsonparser.college_review_json import CollegeReviewJsonParser
from ..college_review_services import CollegeReviewORM
import json
__author__ = 'ravi'


class AddCollegeReview(APIView):

    def post(self, request):
        if request.method == "POST":
            response = dict()
            try:
                college_review_helper = CollegeReviewJsonParser.college_review_json_parser(request.POST.get('jsonData'))
                CollegeReviewORM.save_college_review(college_review_helper)
                response.update({'message': "date saved successfully"})
                response.update({'response_code': status.HTTP_200_OK})
                response.update({'status': 'success'})
            except Exception as ex:
                response.update({'message': 'could not save data'})
                response.update({'response_code': status.HTTP_406_NOT_ACCEPTABLE})
                response.update({'status': 'error'})

            return HttpResponse(json.dumps(response), content_type="application/json")