We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d10915d commit 7ff3ad6Copy full SHA for 7ff3ad6
apps/common/serializers.py
@@ -57,12 +57,18 @@ class Meta:
57
"cpc",
58
"description",
59
"common_name",
60
+ "display_name",
61
"scientific_name",
62
"unit_of_measure",
63
"kcals_per_unit",
64
"aliases",
65
]
66
67
+ display_name = serializers.SerializerMethodField()
68
+
69
+ def get_display_name(self, obj):
70
+ return obj.display_name()
71
72
73
class UserSerializer(serializers.ModelSerializer):
74
class Meta:
0 commit comments