Эксперимент 1

Использовать дочернюю таблицу для получения записей из первичных
This commit is contained in:
iriska-gri committed 2023-09-11 14:56:43 +03:00
1 parent 785f9f0ba8
commit c95853db46
5 files changed
+37 -27

No files matched your search

+3
View File
@@ -19,6 +19,9 @@ class UserCommentAPI(ListCreateAPIView):
def get_queryset(self):
queryset = UserComment.objects.filter(user_id=self.request.user.id, time_create__contains=datetime.date.today())
queryset = queryset.prefetch_related('get_rating')
return queryset
def perform_create(self, serializer):