Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Expose and allow filtering of ingredient language throut the REST api

Roland Geider2f0d6de3619b
diff --git a/wger/nutrition/api/resources.py b/wger/nutrition/api/resources.py
index e0c0628fa..08c31c7cf 100644
--- a/wger/nutrition/api/resources.py
+++ b/wger/nutrition/api/resources.py
@@ -26,11 +26,14 @@ from wger.nutrition.models import NutritionPlan
from wger.nutrition.models import Meal
from wger.nutrition.models import MealItem
from wger.utils.resources import UserObjectsOnlyAuthorization
+
from wger.core.api.resources import LicenseResource
+from wger.core.api.resources import LanguageResource
class IngredientResource(ModelResource):
+ language = fields.ToOneField(LanguageResource, 'language')
license = fields.ToOneField(LicenseResource, 'license')
class Meta:
@@ -48,6 +51,7 @@ class IngredientResource(ModelResource):
'sodium': ALL,
'status': ALL,
'update_date': ALL,
+ 'language': ALL,
'license': ALL,
'license_author': ALL}