def METHOD_NAME(self, names: list[str | type[Model]] | None) -> list[str]:
    """
    Convert a list of models/table names into a list of table names. Deals
    with cases of model inheritance, etc.
    """
    if names is None:
        return []
    table_names = OrderedDict()  # Preserve order and ignore duplicates
    while len(names):
        name = names.pop(0)
        if isinstance(name, type):
            if name._meta.abstract:
                raise ValueError(f"Can't lock abstract model {name.__name__}")
            table_names[name._meta.db_table] = True
            # Include all parent models - the keys are the model classes
            if name._meta.parents:
                names.extend(name._meta.parents.keys())
        else:
            table_names[name] = True
    return list(table_names.keys())