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 Sep 18, 2024
1 parent 90f8d96 commit 5e10bf5
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 @@ -78,6 +78,8 @@ class Meta:
class ProjectSerializer(serializers.ModelSerializer):
"""Used to retrieve project info"""

sdgs = serializers.StringRelatedField(many=True)

class Meta:
model = Project
fields = (
Expand All @@ -94,6 +96,7 @@ class Meta:
"image_logo",
"image_hero",
"image_icon",
"sdgs",
)
read_only_fields = (
"uuid",
Expand Down Expand Up @@ -286,13 +289,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 5e10bf5

Please sign in to comment.