次のクエリセットがあります。
Article.objects.filter(finished=True, updated_at__range=[start, end]).extra(
select={'hour': 'extract(hour from updated_at)'}).values('hour').annotate(categorized=Count('id'))
そして、私はエラーが発生します:
"ProgrammingError: 列参照 "updated_at" はあいまいです LINE 1: SELECT (extract(hour from updated_at)) AS "hour", COUNT("art..."
これについてどうすればよいですか?
編集:クエリセットは、日付「updated_at__range = [start、end]」でフィルタリングしなくても機能しますが、そのフィルターが必要です。