Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Merge branch 'master' into feature/ingredient-images

Roland Geider2fc866c1fb95
diff --cc docs/changelog.rst
index efb77d793,2bf45a800..2fb201480
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@@ -16,8 -16,9 +16,10 @@@ Upgrade steps from 2.0
* New gallery where users can upload pictures to track their progress `#572`_
* Add templates / centrally managed workouts (thanks `@qwert45hi`_) `#639`_
+* Add ingredient images (thanks `@qwert45hi`_)
* Add comment filed to set for user notes `#702`_
+ * Custom measurements such as biceps size or body fat `#133`_
+ * Add picture type to exercise images (thanks `@LucasSD`_) `#589`_
🐛 Bug Fixes:
diff --cc extras/docker/compose/README.md
index ebfa977dd,3e4a7c073..3166b11b4
--- a/extras/docker/compose/README.md
+++ b/extras/docker/compose/README.md
@@@ -20,11 -20,11 +20,12 @@@ To start all services
docker-compose -f extras/docker/compose/docker-compose.yml up
- You might also want to download the exercise images and the ingredients
- (will take some time):
+ Optionally download current exercises from wger.de, exercise images and
+ the ingredients (will take some time):
+ docker-compose -f extras/docker/compose/docker-compose.yml exec web python3 manage.py sync-exercises
docker-compose -f extras/docker/compose/docker-compose.yml exec web wger download-exercise-images
+ docker-compose -f extras/docker/compose/docker-compose.yml exec web wger download-ingredient-images
docker-compose -f extras/docker/compose/docker-compose.yml exec web wger load-online-fixtures
Then open <http://localhost:8000> and log in as: **admin**, password **adminadmin**
diff --cc wger/nutrition/api/serializers.py
index 3030ecfc7,037a38c60..fb9f40a3f
--- a/wger/nutrition/api/serializers.py
+++ b/wger/nutrition/api/serializers.py
@@@ -69,33 -68,13 +69,37 @@@ class WeightUnitSerializer(serializers.
class Meta:
model = WeightUnit
- fields = ['language', 'name']
+ fields = [
+ 'id',
+ 'language',
+ 'name',
+ ]
+class ImageSerializer(serializers.ModelSerializer):
+ """
+ Image serializer
+ """
+
+ ingredient_uuid = serializers.CharField(source='ingredient.uuid', read_only=True)
+ ingredient_id = serializers.CharField(source='ingredient.id', read_only=True)
+
+ class Meta:
+ model = Image
+ fields = [
+ 'id',
+ 'uuid',
+ 'ingredient_id',
+ 'ingredient_uuid',
+ 'image',
+ 'last_update',
+ 'size',
+ 'source_url',
+ 'license',
+ 'license_author',
+ ]
+
+
class IngredientSerializer(serializers.ModelSerializer):
"""
Ingredient serializer