Esempio n. 1
0
 def save(self):
     survey_response = SurveyResponse(
         parent=self.candidacy,
         agreement=int(self.cleaned_data['agreement']),
         refined_issue=self.refined_issue.key(),
         more_explanation=self.cleaned_data['more_explanation'],
         candidacy=self.candidacy.key(),
         national=self.national)
     survey_response.put()
Esempio n. 2
0
 def save(self):
     survey_response = SurveyResponse(
         parent = self.candidacy,
         agreement = int(self.cleaned_data['agreement']),
         refined_issue = self.refined_issue.key(),
         more_explanation = self.cleaned_data['more_explanation'],
         candidacy = self.candidacy.key()
     )
     survey_response.put()
Esempio n. 3
0
 def post(self):
     survey_response = SurveyResponse()
     try: # HTTP_X_APPENGINE_CITY is added when deployed
         survey_response.city = os.environ['HTTP_X_APPENGINE_CITY'] # Categorize by location
     except:
         pass
     survey_response.user_agent = os.environ['HTTP_USER_AGENT'] # Categorize by browser type
     survey_response.opinion = self.request.get('opinion')
     survey_response.improvements = self.request.get('improvements')
     survey_response.rating = self.request.get('rating')
     logging.info(survey_response)
     survey_response.put()
     self.render_template('survey-thank_you.html')
Esempio n. 4
0
 def post(self):
     survey_response = SurveyResponse()
     try:  # HTTP_X_APPENGINE_CITY is added when deployed
         survey_response.city = os.environ[
             'HTTP_X_APPENGINE_CITY']  # Categorize by location
     except:
         pass
     survey_response.user_agent = os.environ[
         'HTTP_USER_AGENT']  # Categorize by browser type
     survey_response.opinion = self.request.get('opinion')
     survey_response.improvements = self.request.get('improvements')
     survey_response.rating = self.request.get('rating')
     logging.info(survey_response)
     survey_response.put()
     self.render_template('survey-thank_you.html')