Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
v-rocheleau committed Jan 4, 2024
1 parent 8652d5d commit 0d161af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chord_metadata_service/phenopackets/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ def to_representation(self, instance):
response["variant_interpretation"] = VariantInterpretationSerializer(
instance.variant_interpretation, many=False, required=False).data

# subject_or_biosample_id is obtained from the referenced subject/biosample
# the referenced object type is added to extra_properties to disambiguate on the client side
# The 'subject_or_biosample_id' value is obtained from the referenced subject/biosample
# The '__related_type' property is added to extra_properties as a computed value ("__" prefix)
# This allows us to disambiguate on the client side for links
extra_properties = response.get("extra_properties", {})
if instance.subject:
response["subject_or_biosample_id"] = instance.subject.id
Expand Down

0 comments on commit 0d161af

Please sign in to comment.