mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-10 08:38:34 -05:00
basic food property calculation
This commit is contained in:
@@ -68,7 +68,7 @@ from cookbook.models import (Automation, BookmarkletImport, CookLog, CustomFilte
|
||||
MealType, Recipe, RecipeBook, RecipeBookEntry, ShareLink, ShoppingList,
|
||||
ShoppingListEntry, ShoppingListRecipe, Space, Step, Storage,
|
||||
Supermarket, SupermarketCategory, SupermarketCategoryRelation, Sync,
|
||||
SyncLog, Unit, UserFile, UserPreference, UserSpace, ViewLog, UnitConversion, NutritionType)
|
||||
SyncLog, Unit, UserFile, UserPreference, UserSpace, ViewLog, UnitConversion, FoodPropertyType)
|
||||
from cookbook.provider.dropbox import Dropbox
|
||||
from cookbook.provider.local import Local
|
||||
from cookbook.provider.nextcloud import Nextcloud
|
||||
@@ -820,10 +820,10 @@ class RecipeViewSet(viewsets.ModelViewSet):
|
||||
'steps__ingredients__food__onhand_users',
|
||||
'steps__ingredients__food__substitute',
|
||||
'steps__ingredients__food__child_inherit_fields',
|
||||
'steps__ingredients__food__foodnutrition_set',
|
||||
'steps__ingredients__food__foodnutrition_set__food',
|
||||
'steps__ingredients__food__foodnutrition_set__food_unit',
|
||||
'steps__ingredients__food__foodnutrition_set__nutrition_type',
|
||||
# 'steps__ingredients__food__foodnutrition_set',
|
||||
# 'steps__ingredients__food__foodnutrition_set__food',
|
||||
# 'steps__ingredients__food__foodnutrition_set__food_unit',
|
||||
# 'steps__ingredients__food__foodnutrition_set__nutrition_type',
|
||||
'steps__ingredients__unit',
|
||||
'steps__ingredients__unit__unit_conversion_base_relation',
|
||||
'steps__ingredients__unit__unit_conversion_base_relation__base_unit',
|
||||
@@ -970,7 +970,7 @@ class UnitConversionViewSet(viewsets.ModelViewSet):
|
||||
|
||||
|
||||
class NutritionTypeViewSet(viewsets.ModelViewSet):
|
||||
queryset = NutritionType.objects
|
||||
queryset = FoodPropertyType.objects
|
||||
serializer_class = NutritionTypeSerializer
|
||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||
|
||||
|
||||
@@ -246,15 +246,15 @@ def unit_conversion(request):
|
||||
|
||||
|
||||
@group_required('user')
|
||||
def nutrition_type(request):
|
||||
def food_property_type(request):
|
||||
# model-name is the models.js name of the model, probably ALL-CAPS
|
||||
return render(
|
||||
request,
|
||||
'generic/model_template.html',
|
||||
{
|
||||
"title": _("Unit Conversions"),
|
||||
"title": _("Food Property Types"),
|
||||
"config": {
|
||||
'model': "NUTRITION_TYPE", # *REQUIRED* name of the model in models.js
|
||||
'model': "FOOD_PROPERTY_TYPE", # *REQUIRED* name of the model in models.js
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user