Esempio n. 1
0
    def load_data_append(self):
        '''@load_data_append

        This method validates the supplied parameters, before being appended to
        existing entries, from corresponding tables in the SQL database.

        '''

        # instantiate class
        session = Data_Append(self.data)

        # define current session id
        session_id = self.data['data']['settings']['session_id']
        session.validate_id(session_id)

        # implement class methods
        if not session.validate_arg_none() and not session.get_errors():
            session.validate_premodel_settings()
            session.validate_file_extension()
            session.check()

            session_entity = session.save_entity('data_append', session_id)
            if session_entity['status']:
                session.check()

                session.dataset_to_dict(session_id)
                session.check()

                session.save_observation_label('data_append', session_id)
                session.check()

                session.save_premodel_dataset()
                session.check()

            return 'Dataset(s) properly appended into database'
        else:
            print session.get_errors()
            return None
    def load_data_append(self):

        # instantiate class
        session = Data_Append(self.data)

        # define current session id
        session_id = self.data['data']['settings']['svm_session_id']
        session.validate_id(session_id)

        # implement class methods
        if not session.validate_arg_none() and not session.get_errors():
            session.validate_svm_settings()
            session.validate_mime_type()
            session.check()

            session_entity = session.save_svm_entity('data_append', session_id)
            if session_entity['status']:
                session.check()

                session.dataset_to_dict(session_id)
                session.check()

                session.save_observation_label('data_append', session_id)
                session.check()

                session.save_svm_dataset()
                session.check()

            return 'Dataset(s) properly appended into database'
        else:
            print session.get_errors()
            return None