Django 如何制作';#x27;在查询的where子句中?

Django 如何制作';#x27;在查询的where子句中?,django,Django,我有一个疑问: countries = Country.objects.filter(country_desc='') countries = Country.objects.filter(~Q(country_desc='')) 国家怎么样? 下面的查询返回没有描述的国家,但对于其他有描述的国家,我尝试了此查询: countries = Country.objects.filter(country_desc='') countries = Country.objects.filter(~

我有一个疑问:

countries = Country.objects.filter(country_desc='')
countries = Country.objects.filter(~Q(country_desc=''))
国家怎么样? 下面的查询返回没有描述的国家,但对于其他有描述的国家,我尝试了此查询:

countries = Country.objects.filter(country_desc='')
countries = Country.objects.filter(~Q(country_desc=''))
但它不起作用。它返回一个错误:

关键字arg后的非关键字arg


还有其他有效的方法吗?

只需使用排除而不是筛选:)