正常排序如: res = queryset.all().order_by('-publish_time')那假设想在title的字段里有abc的排在前面,那应该怎么写呢?谢谢了
res = queryset.all().order_by('-publish_time')
认证高级PHP讲师
res = queryset.extra(select = { '_has' : 'instr(title, "abc")'}).order _by('-_has')
认证高级PHP讲师