def scaffold_sortable_columns(self):
        """
            Return a dictionary of sortable columns (name, field)
        """
        columns = {}

        for n, f in self._get_model_fields():
            if type(f) in SORTABLE_FIELDS:
                if self.column_display_pk or type(f) != mongoengine.ObjectIdField:
                    columns[n] = f

        return columns
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/mongoengine/view.py/ModelView.scaffold_sortable_columns/original