[Django]-'dict' object has no attribute '_meta' on Django Serializer

45👍

events=Event.objects.filter(e_date__year=datetime.today().year).filter(e_date__month=datetime.today().month,e_status=1).only('e_name','e_date')

Serializer waits for normal queryset, not ValuesQuerySet (which is returned by values). If you want to query only certain fileds, use only.

Leave a comment