def edit_note(self): """ Edit the note related with this dataset or create a new one and edit it """ try: note_id = self.note_id __notes__.edit_note(note_id) except AttributeError: self.note_id = __notes__.new_note() __notes__.edit_note(self.note_id)
def add_note_to_dataset(self, text_to_add): # Now log in the note that we did this note_id = __datasets__.current.get_note_id() if note_id: __notes__.add_auto_text_to_note(note_id, text_to_add) else: # There was no not yet. Create it and add the text. note_id = __notes__.new_note() __datasets__.current.set_note_id(note_id) __notes__.add_auto_text_to_note(note_id, text_to_add)
def add_auto_label_for_connection(self,connection_id, name): """ Given a connection id, label name and a current dataset, add an auto note""" text_to_add = "Added label {}".format(name) model = self.get_the_model_of_a_connection(connection_id) note_id = model.get_note_id() if not note_id: # There was not originaly a note, so we should now store the new created not in the model. note_id =__notes__.new_note() model.set_note_id(note_id) __notes__.add_auto_text_to_note(note_id, text_to_add) print_info('Connection has note id {}'.format(note_id))
def add_note_to_dataset(self, text_to_add): """ Add an auto note to the dataset where this group of model belongs """ try: note_id = __datasets__.current.get_note_id() except AttributeError: # The dataset may be already deleted? return False if note_id: __notes__.add_auto_text_to_note(note_id, text_to_add) else: # There was no note yet. Create it and add the text. note_id = __notes__.new_note() __datasets__.current.set_note_id(note_id) __notes__.add_auto_text_to_note(note_id, text_to_add)
def add_auto_label_for_connection(self, group_of_model_id, connection_id, name): """ Given a connection id, label name and a current dataset, add an auto note""" text_to_add = "Added label {}".format(name) model = self.get_the_model_of_a_connection( group_of_model_id, connection_id) try: note_id = model.get_note_id() except AttributeError: print_error('Some error trying to read tht note id of the model.') return False if not note_id: # There was not originaly a note, so we should now store the new created not in the model. note_id =__notes__.new_note() model.set_note_id(note_id) __notes__.add_auto_text_to_note(note_id, text_to_add) print_info('Connection has note id {}'.format(note_id))
def add_auto_label_for_connection(self, group_of_model_id, connection_id, name): """ Given a connection id, label name and a current dataset, add an auto note""" text_to_add = "Added label {}".format(name) model = self.get_the_model_of_a_connection(group_of_model_id, connection_id) if model != None: try: note_id = model.get_note_id() except AttributeError: print_error( 'Some error trying to read tht note id of the model.') return False if not note_id: # There was not originaly a note, so we should now store the new created not in the model. note_id = __notes__.new_note() model.set_note_id(note_id) __notes__.add_auto_text_to_note(note_id, text_to_add) print_info('Connection has note id {}'.format(note_id))
def add_note(self): """ Add a note to the model """ note_id = __notes__.new_note() self.set_note_id(note_id)