我有以下 Django 声明:
pending_companies = PendingCompany.objects.order_by('submit_time').reverse()
输出:
petroshkin Nov. 15, 2013, 2:27 p.m.
Copmew345 Nov. 13, 2013, 2:26 p.m.
SEWORKS Nov. 13, 2013, 11:17 a.m.
Copmew345 Nov. 13, 2013, 11:06 a.m.
Copmew345 Nov. 13, 2013, 11:07 a.m.
Copmew345 Nov. 13, 2013, 11:09 a.m.
Copmew345re Nov. 12, 2013, 11:07 a.m.
整体数据应颠倒,但对于重复公司,数据不应颠倒:
Petroshkin Nov. 15, 2013, 2:27 p.m.
SEWORKS Nov. 13, 2013, 11:17 a.m
Copmew345 Nov. 13, 2013, 11:06 a.m.
Copmew345 Nov. 13, 2013, 11:07 a.m.
Copmew345 Nov. 13, 2013, 11:09 a.m.
Copmew345 Nov. 13, 2013, 2:26 p.m.
Copmew345re Nov. 12, 2013, 11:07 a.m.
我尝试使用以下语句,但没有给我结果:
pending_companies.query.group_by = ['name']