Skip to content

Commit

Permalink
feat: update serializers: project and sdg
Browse files Browse the repository at this point in the history
  • Loading branch information
dmartin4820 committed Oct 29, 2024
1 parent 2c42222 commit 254c25a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/core/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class Meta:
class ProjectSerializer(serializers.ModelSerializer):
"""Used to retrieve project info"""

sdgs = serializers.StringRelatedField(many=True)

class Meta:
model = Project
fields = (
Expand All @@ -117,6 +119,7 @@ class Meta:
"image_logo",
"image_hero",
"image_icon",
"sdgs",
)
read_only_fields = (
"uuid",
Expand Down Expand Up @@ -309,13 +312,16 @@ class SdgSerializer(serializers.ModelSerializer):
Used to retrieve Sdg
"""

projects = serializers.StringRelatedField(many=True)

class Meta:
model = Sdg
fields = (
"uuid",
"name",
"description",
"image",
"projects",
)
read_only_fields = (
"uuid",
Expand Down

0 comments on commit 254c25a

Please sign in to comment.