def post(self):
     """ handler of dealing with geo info update """
     if self._is_json(self.request.get('geo_data')):
         json_geo_data = json.loads(self.request.get('geo_data'))
         for key in json_geo_data.keys():
             new_geo_info = NewAlbumGeoInfo( id = key )
             new_geo_info.album_id = key
             new_geo_info.album_title = json_geo_data[key]['album_title']
             new_geo_info.album_description = json_geo_data[key]['album_description']
             new_geo_info.album_thumbnail = json_geo_data[key]['album_thumbnail']
             new_geo_info.album_link = json_geo_data[key]['album_link']
             new_geo_info.album_lat = json_geo_data[key]['album_lat']
             new_geo_info.album_lng = json_geo_data[key]['album_lng']
             
             new_geo_info.put()
             
         processing_status = 'success'
         
     else:
         processing_status = 'received variable is not in JSON format'
     
     # ajax response
     ajax_response = {'processing_status': processing_status}
     self.response.out.headers['Content-Type'] = 'text/json'
     self.response.out.write(json.dumps(ajax_response))
    def post(self):
        """ handler of dealing with geo info update """
        if self._is_json(self.request.get("geo_data")):
            json_geo_data = json.loads(self.request.get("geo_data"))
            for key in json_geo_data.keys():
                new_geo_info = NewAlbumGeoInfo(id=key)
                new_geo_info.album_id = key
                new_geo_info.album_title = json_geo_data[key]["album_title"]
                new_geo_info.album_description = json_geo_data[key]["album_description"]
                new_geo_info.album_thumbnail = json_geo_data[key]["album_thumbnail"]
                new_geo_info.album_link = json_geo_data[key]["album_link"]
                new_geo_info.album_lat = json_geo_data[key]["album_lat"]
                new_geo_info.album_lng = json_geo_data[key]["album_lng"]

                new_geo_info.put()

            processing_status = "success"

        else:
            processing_status = "received variable is not in JSON format"

        # ajax response
        ajax_response = {"processing_status": processing_status}
        self.response.out.headers["Content-Type"] = "text/json"
        self.response.out.write(json.dumps(ajax_response))