我对 django、python 和 postgres 真的很陌生......我似乎无法找到关于如何在使用 Model 作为查询方法时不区分大小写的 order_by 的答案,只有当您使用直接 SQL 查询时。
Model
@classmethod
def get_channel_list(cls, account):
return cls.objects.filter(accountid=account).order_by('-name').values_list('name', 'channelid')
当前订购的数据集和顺序
test
b test
a test channel
a test channel
a test 2
a b test
Test Channel
Test 3
Test 3
Test 2 Channel
任何帮助将非常感激。