Esempio n. 1
0
 def import_models(self, fake=False):
     with BulkCreator(model_class=CommentFile) as commentfile_bulk_creator:
         for object_dict in self.v2filemeta_directoryparser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(pprint.pformat(object_dict)))
             else:
                 comment_file = self._create_comment_file_from_object_id(object_dict=object_dict)
                 commentfile_bulk_creator.add(comment_file)
Esempio n. 2
0
 def import_models(self, fake=False):
     with BulkCreator(model_class=CommentFile) as commentfile_bulk_creator:
         for object_dict in self.v2staticfeedback_directoryparser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(pprint.pformat(object_dict)))
             else:
                 group_comment, commentfiles = self._create_group_comment_from_object_dict(object_dict=object_dict)
                 if commentfiles:
                     commentfile_bulk_creator.add(*commentfiles)
Esempio n. 3
0
 def import_models(self, fake=False):
     directory_parser = self.v2deadline_directoryparser
     directory_parser.set_max_id_for_models_with_auto_generated_sequence_numbers(model_class=self.get_model_class())
     with BulkCreator(model_class=FeedbackSet) as feedbackset_bulk_creator:
         for object_dict in directory_parser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(pprint.pformat(object_dict)))
             else:
                 feedback_set = self._create_feedback_set_from_object_dict(object_dict=object_dict)
                 feedbackset_bulk_creator.add(feedback_set)
Esempio n. 4
0
 def import_models(self, fake=False):
     directory_parser = self.v2qualifiesforexam_status_directoryparser
     directory_parser.set_max_id_for_models_with_auto_generated_sequence_numbers(model_class=self.get_model_class())
     with BulkCreator(model_class=self.get_model_class()) as status_bulk_creator:
         for object_dict in directory_parser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(pprint.pformat(object_dict)))
             else:
                 status = self._create_status_from_object_dict(object_dict=object_dict)
                 status_bulk_creator.add(status)
Esempio n. 5
0
 def import_models(self, fake=False):
     directory_parser = self.v2assignmentgroup_directoryparser
     directory_parser.set_max_id_for_models_with_auto_generated_sequence_numbers(
         model_class=self.get_model_class())
     with BulkCreator(model_class=AssignmentGroup) as group_bulk_creator:
         for object_dict in directory_parser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(
                     pprint.pformat(object_dict)))
             else:
                 group = self._create_assignmentgroup_from_object_dict(
                     object_dict=object_dict)
                 group_bulk_creator.add(group)
 def import_models(self, fake=False):
     directory_parser = self.v2pointrangetograde_directoryparser
     directory_parser.set_max_id_for_models_with_auto_generated_sequence_numbers(
         model_class=self.get_model_class())
     with BulkCreator(model_class=self.get_model_class()
                      ) as point_range_to_grade_bulk_creator:
         for object_dict in directory_parser.iterate_object_dicts():
             if fake:
                 print('Would import: {}'.format(
                     pprint.pformat(object_dict)))
             else:
                 point_range_to_grade = self._create_point_range_to_grade_from_object_dict(
                     object_dict=object_dict)
                 point_range_to_grade_bulk_creator.add(point_range_to_grade)