add api endpoints and genereic views

This commit is contained in:
vabene1111
2023-02-24 23:17:12 +01:00
parent ff6c8d5822
commit 2e013e7b43
6 changed files with 2031 additions and 943 deletions

View File

@ -228,3 +228,33 @@ def step(request):
}
}
)
@group_required('user')
def unit_conversion(request):
# model-name is the models.js name of the model, probably ALL-CAPS
return render(
request,
'generic/model_template.html',
{
"title": _("Unit Conversions"),
"config": {
'model': "UNIT_CONVERSION", # *REQUIRED* name of the model in models.js
}
}
)
@group_required('user')
def nutrition_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"),
"config": {
'model': "NUTRITION_TYPE", # *REQUIRED* name of the model in models.js
}
}
)