finished making FoodList completely generic

This commit is contained in:
smilerz
2021-09-05 14:15:58 -05:00
parent d33a49538e
commit 638dd96812
16 changed files with 155441 additions and 257 deletions

View File

@@ -110,4 +110,16 @@ def keyword(request):
@group_required('user')
def food(request):
return render(request, 'generic/model_template.html', {"title": _("Foods")})
# recipe-param is the name of the parameters used when filtering recipes by this attribute
# model-name is the models.js name of the model, probably ALL-CAPS
return render(
request,
'generic/model_template.html',
{
"title": _("Foods"),
"config": {
'model': "FOOD", # *REQUIRED* name of the model in models.js
'recipe_param': 'foods' # *OPTIONAL* name of the listRecipes parameter if filtering on this attribute
}
}
)