def METHOD_NAME(model_cls):
    """
    Given a TableModel class, return a new class that pretends to have an
    extra row at the end. This row is used to display "Add..." buttons in
    the GUI.
    """
    class ProxyModel(model_cls):
        def __init__(self, *args, **kwds):
            super(ProxyModel, self).__init__(*args, **kwds)
        def rowCount(self, parent=QModelIndex()):
            """
            Return number of rows in the model.
            This proxy model keeps an extra row at the end for buttons.
            """
            return super(ProxyModel, self).rowCount(parent) + 1
        def headerData(self, section, orientation, role=Qt.DisplayRole):
            """
            Return header information for row/column.
            Skip vertical header for the last row, which is used for buttons.
            """
            if orientation == Qt.Vertical:
                if section >= super(ProxyModel, self).rowCount():
                    return ""
            return super(ProxyModel, self).headerData(section, orientation, role)
        def _getDisplayRoleData(self, index):
            # Last row is just buttons
            if index.row() >= super(ProxyModel, self).rowCount():
                return ""
            return model_cls._getDisplayRoleData(self, index)
    return ProxyModel