def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def closeEvent(self, event: QCloseEvent):
        settings.write("{}/geometry".format(self.__class__.__name__), self.saveGeometry())
        super().closeEvent(event)