(self, field, **kwargs)
Return a column object suitable for model field.

        Returns:
            `.Column` object or `None`
Return a column object suitable for model field.
Return a column object suitable for model field .
def column_for_field(self, field, **kwargs):
        """
        Return a column object suitable for model field.

        Returns:
            `.Column` object or `None`
        """
        if field is None:
            return self.columns[0](**kwargs)

        # Iterate in reverse order as columns are registered in order
        # of least to most specialised (i.e. Column is registered
        # first). This also allows user-registered columns to be
        # favoured.
        for candidate in reversed(self.columns):
            if hasattr(field, "get_related_field"):
                verbose_name = field.get_related_field().verbose_name
            else:
                verbose_name = getattr(field, "verbose_name", field.name)
            kwargs["verbose_name"] = capfirst(verbose_name)
            column = candidate.from_field(field, **kwargs)
            if column is None:
                continue
            return column
def column_for_field ( self , field , * * kwargs ) : if field is None : return self . columns [ 0 ] ( * * kwargs ) # Iterate in reverse order as columns are registered in order # of least to most specialised (i.e. Column is registered # first). This also allows user-registered columns to be # favoured. for candidate in reversed ( self . columns ) : if hasattr ( field , "get_related_field" ) : verbose_name = field . get_related_field ( ) . verbose_name else : verbose_name = getattr ( field , "verbose_name" , field . name ) kwargs [ "verbose_name" ] = capfirst ( verbose_name ) column = candidate . from_field ( field , * * kwargs ) if column is None : continue return column