📜  mongoengine ObjectIdField - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:21.456000             🧑  作者: Mango

代码示例1
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