Skip to content

Commit

Permalink
Create serializers for Stakeholder model
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 4, 2024
1 parent 6a91b2b commit face6c4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/ebios_rm/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,21 @@ class RoToReadSerializer(BaseModelSerializer):
class Meta:
model = RoTo
fields = "__all__"


class StakeholderWriteSerializer(BaseModelSerializer):
class Meta:
model = Stakeholder
exclude = ["created_at", "updated_at", "folder"]


class StakeholderReadSerializer(BaseModelSerializer):
str = serializers.CharField(source="__str__")
ebios_rm_study = FieldsRelatedField()
folder = FieldsRelatedField()
entity = FieldsRelatedField()
applied_controls = FieldsRelatedField(many=True)

class Meta:
model = Stakeholder
fields = "__all__"

0 comments on commit face6c4

Please sign in to comment.