1def scaffold_sortable_columns(self):
2 """
3 Return a dictionary of sortable columns (name, field)
4 """
5 columns = {}
6
7 for n, f in self._get_model_fields():
8 if type(f) in SORTABLE_FIELDS:
9 if self.column_display_pk or type(f) != mongoengine.ObjectIdField:
10 columns[n] = f
11
12 return columns
13