q = q.extra(select={ 'date_is_null': 'dateWORequired IS NULL', }, order_by=['date_is_null','dateWORequired'],)你可能需要在order_by部分的date_is_null之前加一个-,但这是控制行为的方式。

q = q.extra(select={ 'date_is_null': 'dateWORequired IS NULL', }, order_by=['date_is_null','dateWORequired'],)你可能需要在order_by部分的date_is_null之前加一个-,但这是控制行为的方式。