Q:

Wrong Return in Django TruncWeek

TruncDate and TruncMonth Return Right Data , but when using TruncWeek the Data not return like i am using TruncMonth/Date
two function models using TruncDate and TruncMonth running well, and TruncWeek Should Running necessarily
class TblogByDateSerializer(serializers.ModelSerializer):
    groupby = serializers.CharField()
    total = serializers.IntegerField()
    class Meta:
        model = Tblog
        fields = ('groupby','total')
Queryset : 
Tblog.objects.filter(status='success').annotate(groupby=TruncMonth('createtime',output_field=DateField())).values('groupby').annotate(total=Count('createtime')).order_by('-groupby')[:7]
if i change the TruncMonth function to TruncWeek the code should Grouping By Week,
the result when i am using Using TruncMonth and Using TruncDate this is the problem when Using TruncWeek

The result when using TruncMonth and TruncDate, the TruncWeek should returning like this too ,

"results": [
    {
        "groupby": "2019-08-01",
        "total": 77
    },
    {
        "groupby": "2019-07-01",
        "total": 24
    }
"results": [
    {
        "groupby": "2019-08-06",
        "total": 29
    },
    {
        "groupby": "2019-08-05",
        "total": 6
    },
    {
        "groupby": "2019-08-04",
        "total": 4
    },
    {
        "groupby": "2019-08-03",
        "total": 4
    },
    {

When Using TruncWeek

"results": [
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    },
    {
        "groupby": "2019-08-05",
        "total": 1
    }

A:

i change theTruncWeek('createtime',output_field=DateField()) to .TruncWeek('createtime') and its worked for me,
i think the problem is using groupby = serializers.CharField() and outpufield using DateField

