def METHOD_NAME(self, name):
    from . import insert, model
    if name in model.model().names():
        view = self.tool().mainwindow().currentView()
        if view.hasFocus() or self.tool().widget().searchEntry.hasFocus():
            insert.insert(name, view)