From 728e542d64fad854dbec524287fb586e6f1624f7 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 00:04:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/organizations/serializers.py | 4 ++-- src/organizations/urls.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/organizations/serializers.py b/src/organizations/serializers.py index 73ef280..02d4b2f 100644 --- a/src/organizations/serializers.py +++ b/src/organizations/serializers.py @@ -24,7 +24,7 @@ class LocationSerializer(serializers.ModelSerializer): class OrganizationListSerializer(serializers.ModelSerializer): location = LocationSerializer() - images = serializers.StringRelatedField(many=True) + images = serializers.StringRelatedField(source='image', many=True) class Meta: model = Organization @@ -33,7 +33,7 @@ class OrganizationListSerializer(serializers.ModelSerializer): class OrganizationCreateSerializer(serializers.ModelSerializer): location = LocationSerializer() - images = serializers.PrimaryKeyRelatedField(many=True, queryset=OrganizationImagesRepository) + images = serializers.PrimaryKeyRelatedField(source='image', many=True, queryset=OrganizationImagesRepository) owner = serializers.StringRelatedField() category = serializers.PrimaryKeyRelatedField(queryset=CategoryRepository.all()) diff --git a/src/organizations/urls.py b/src/organizations/urls.py index 3609958..f550e3e 100644 --- a/src/organizations/urls.py +++ b/src/organizations/urls.py @@ -11,5 +11,5 @@ urlpatterns = [ path('category//organizations/', OrganizationByCategoryListAPIView.as_view()), path('search//', OrganizationSearchListAPIView.as_view()), path('categories/', CategoryListAPIView.as_view()), - path('upload/', UploadAPIView.as_view()) + # path('upload/', UploadAPIView.as_view()) ] + router.urls