def _set_survey_flag(self): # Here not at top to break import loop from modules.regconf.regconf import FormSubmission form_submissions = FormSubmission.all() form_submissions.filter('form_name', 'exit_survey_3') form_submissions.filter('user', self.student_key) self.done_with_survey = bool(form_submissions.count(limit=1))
def run(self): query = FormSubmission.all().filter('form_name =', 'pre').run() for submission in query: yield { 'email': FormSubmission.user.get_value_for_datastore(submission).name(), 'curricular_aim': Markup(submission.curricular_aim), }
def run(self): query = FormSubmission.all() query.filter('form_name IN', [ 'exit_survey_1', 'exit_survey_2', 'exit_survey_3', 'exit_survey_features' ]) query.order('user') for student, all_responses in itertools.groupby( query.run(), FormSubmission.user.get_value_for_datastore): # all_responses may contain more than one submission per form, # we need to choose the most recent one for each form. sorted_responses = sorted(list(all_responses), key=lambda x: x.submitted, reverse=True) row = {'student': student.name()} seen = set() for response in sorted_responses: if response.form_name not in seen: row.update(db.to_dict(response)) seen.add(response.form_name) yield row
def run(self): query = FormSubmission.all() query.filter('form_name IN', ['exit_survey_1', 'exit_survey_2', 'exit_survey_3', 'exit_survey_features']) query.order('user') for student, all_responses in itertools.groupby(query.run(), FormSubmission.user.get_value_for_datastore): # all_responses may contain more than one submission per form, # we need to choose the most recent one for each form. sorted_responses = sorted(list(all_responses), key=lambda x: x.submitted, reverse=True) row = {'student': student.name()} seen = set() for response in sorted_responses: if response.form_name not in seen: row.update(db.to_dict(response)) seen.add(response.form_name) yield row
def find_can_use_location(student): conf_submission = FormSubmission.all().filter('user ='******'form_name =', 'conf').get() if conf_submission: return conf_submission.accept_location
def find_can_use_location(student): conf_submission = FormSubmission.all().filter( 'user ='******'form_name =', 'conf').get() if conf_submission: return conf_submission.accept_location