if f is an instance of ModelFiled, for every f in opts.virtual_fields, append f to a list, substitute the resulting list for sortable_virtual_fields.
sortable_virtual_fields = [ f for f in opts . virtual_fields if isinstance ( f , ModelField ) ]