Exemplo n.º 1
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     # include all the sections and children to avoid querying them in a loop
     self.survey = (Survey.query
                    .filter_by(id=request.view_args['survey_id'], is_deleted=False)
                    .options(joinedload(Survey.sections).joinedload(SurveySection.children))
                    .one())
Exemplo n.º 2
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     # include all the sections and children to avoid querying them in a loop
     self.survey = (Survey.query.filter_by(
         id=request.view_args['survey_id'], is_deleted=False).options(
             joinedload(Survey.sections).joinedload(
                 SurveySection.children)).one())
Exemplo n.º 3
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     # include all the sections and children to avoid querying them in a loop
     self.survey = (Survey
                    .find(id=request.view_args['survey_id'], is_deleted=False)
                    .options(joinedload(Survey.sections).joinedload(SurveySection.children))
                    .one())
Exemplo n.º 4
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     self.question = (SurveyQuestion.query.filter(
         SurveyQuestion.id == request.view_args['question_id'],
         ~Survey.is_deleted).join(SurveyQuestion.survey).options(
             contains_eager(SurveyQuestion.survey)).one())
     self.survey = self.question.survey
Exemplo n.º 5
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     self.question = SurveyQuestion.find_one(
         SurveyQuestion.id == request.view_args['question_id'],
         ~Survey.is_deleted,
         _join=SurveyQuestion.survey,
         _eager=SurveyQuestion.survey)
     self.survey = self.question.survey
Exemplo n.º 6
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     self.text = SurveyText.find_one(
         SurveyText.id == request.view_args['text_id'],
         ~Survey.is_deleted,
         _join=SurveyText.survey,
         _eager=SurveyText.survey)
     self.survey = self.text.survey
Exemplo n.º 7
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     survey_strategy = joinedload('survey')
     answers_strategy = defaultload('answers').joinedload('question')
     self.submission = (SurveySubmission
                        .find(id=request.view_args['submission_id'])
                        .options(answers_strategy, survey_strategy)
                        .one())
Exemplo n.º 8
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     self.question = SurveyQuestion.find_one(
         SurveyQuestion.id == request.view_args['question_id'],
         ~Survey.is_deleted,
         _join=SurveyQuestion.survey,
         _eager=SurveyQuestion.survey)
     self.survey = self.question.survey
Exemplo n.º 9
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     self.text = SurveyText.find_one(
         SurveyText.id == request.view_args['text_id'],
         ~Survey.is_deleted,
         _join=SurveyText.survey,
         _eager=SurveyText.survey)
     self.survey = self.text.survey
Exemplo n.º 10
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     survey_strategy = joinedload('survey')
     answers_strategy = defaultload('answers').joinedload('question')
     sections_strategy = joinedload('survey').defaultload(
         'sections').joinedload('children')
     self.submission = (SurveySubmission.query.filter_by(
         id=request.view_args['submission_id']).options(
             answers_strategy, survey_strategy, sections_strategy).one())
Exemplo n.º 11
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     survey_strategy = joinedload('survey')
     answers_strategy = defaultload('answers').joinedload('question')
     sections_strategy = joinedload('survey').defaultload('sections').joinedload('children')
     self.submission = (SurveySubmission
                        .find(id=request.view_args['submission_id'])
                        .options(answers_strategy, survey_strategy, sections_strategy)
                        .one())
Exemplo n.º 12
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     survey_strategy = joinedload('survey')
     answers_strategy = defaultload('answers').joinedload('question')
     sections_strategy = joinedload('survey').defaultload('sections').joinedload('children')
     self.submission = (SurveySubmission
                        .find(id=request.view_args['submission_id'])
                        .options(answers_strategy, survey_strategy, sections_strategy)
                        .one())
Exemplo n.º 13
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     self.question = SurveyQuestion.find_one(SurveyQuestion.id == request.view_args['question_id'],
                                             ~Survey.is_deleted,
                                             _join=SurveyQuestion.survey, _eager=SurveyQuestion.survey)
     self.survey = self.question.survey
Exemplo n.º 14
0
 def _checkParams(self, params):
     RHManageSurveysBase._checkParams(self, params)
     self.text = SurveyText.find_one(SurveyText.id == request.view_args['text_id'], ~Survey.is_deleted,
                                     _join=SurveyText.survey, _eager=SurveyText.survey)
     self.survey = self.text.survey
Exemplo n.º 15
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     self.question = SurveyQuestion.find_one(SurveyQuestion.id == request.view_args['question_id'],
                                             ~Survey.is_deleted,
                                             _join=SurveyQuestion.survey, _eager=SurveyQuestion.survey)
     self.survey = self.question.survey
Exemplo n.º 16
0
 def _process_args(self):
     RHManageSurveysBase._process_args(self)
     self.text = SurveyText.find_one(SurveyText.id == request.view_args['text_id'], ~Survey.is_deleted,
                                     _join=SurveyText.survey, _eager=SurveyText.survey)
     self.survey = self.text.survey