code: def save(self):
          record = self.record()
          if not record:
              logger.warning('No record has been defined for %s.' % self)
              return False
          if not self.signalsBlocked():
              self.aboutToSaveRecord.emit(record)
              self.aboutToSave.emit()
          values = self.saveValues()
          check = values.copy()
          for column_name, value in check.items():
              try:
                  equals = value == record.recordValue(column_name)
              except UnicodeWarning:
                  equals = False
              if equals:
                  check.pop(column_name)
          if not check and record.isRecord():
              if not self.signalsBlocked():
                  self.recordSaved.emit(record)
                  self.saved.emit()
                  self._saveSignalBlocked = False
              else:
                  self._saveSignalBlocked = True
              if self.autoCommitOnSave():
                  status, result = record.commit()
                  if status == 'errored':
                      if 'db_error' in result:
                          msg = nativestring(result['db_error'])
                      else:
                          msg = 'An unknown database error has occurred.'
                      QMessageBox.information(self,
                                              'Commit Error',
                                              msg)
                      return False
              return True
          success, msg = record.validateValues(check)
          if ( not success ):
              QMessageBox.information(None, 'Could Not Save', msg)
              return False
          record.setRecordValues(**values)
          success, msg = record.validateRecord()
          if not success:
              QMessageBox.information(None, 'Could Not Save', msg)
              return False
          if ( self.autoCommitOnSave() ):
              result = record.commit()
              if 'errored' in result:
                  QMessageBox.information(None, 'Could Not Save', msg)
                  return False
          if ( not self.signalsBlocked() ):
              self.recordSaved.emit(record)
              self.saved.emit()
              self._saveSignalBlocked = False
          else:
              self._saveSignalBlocked = True
          return True