def get_column_for_modelfield(model_field):

    # If the field points to another model, we want to get the pk field of that other model and use
    # that as the real field.  It is possible that a ForeignKey points to a model with table
    # inheritance, however, so we need to traverse the internal OneToOneField as well, so this will
    # climb the 'pk' field chain until we have something real.
    while model_field.rel:
        model_field = model_field.rel.to._meta.pk
    for ColumnClass, modelfield_classes in COLUMN_CLASSES:
        if isinstance(model_field, tuple(modelfield_classes)):
            return ColumnClass
Return the name of the column specified by the
dataset/ETHPy150Open pivotal-energy-solutions/django-datatable-view/datatableview/columns.py/get_column_for_modelfield--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/ui/wx/grid/composite_grid_model.py/CompositeGridModel.get_column_name