Mongoengine ObjectIdfield

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
Filthy Finch