Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Expose the product barcode over the API

Roland Geiderefa27eadd0f5
diff --git a/wger/nutrition/api/serializers.py b/wger/nutrition/api/serializers.py
index 074fdeb57..fc4c22c6b 100644
--- a/wger/nutrition/api/serializers.py
+++ b/wger/nutrition/api/serializers.py
@@ -80,6 +80,7 @@ class IngredientSerializer(serializers.ModelSerializer):
model = Ingredient
fields = [
'id',
+ 'code',
'name',
'creation_date',
'update_date',
diff --git a/wger/nutrition/api/views.py b/wger/nutrition/api/views.py
index 0368900e0..878a224b3 100644
--- a/wger/nutrition/api/views.py
+++ b/wger/nutrition/api/views.py
@@ -67,6 +67,7 @@ class IngredientViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = IngredientSerializer
ordering_fields = '__all__'
filterset_fields = (
+ 'code',
'carbohydrates',
'carbohydrates_sugar',
'creation_date',