hidden field for movement

This commit is contained in:
vabene1111
2019-11-19 20:57:42 +01:00
parent e62219f031
commit 8281bb52e8
2 changed files with 6 additions and 1 deletions

View File

@ -35,9 +35,11 @@ class ExternalRecipeForm(forms.ModelForm):
class InternalRecipeForm(forms.ModelForm):
table_pos = forms.CharField(show_hidden_initial=True, required=False, widget=forms.HiddenInput())
class Meta:
model = Recipe
fields = ('name', 'instructions', 'time', 'keywords')
fields = ('name', 'table_pos', 'instructions', 'time', 'keywords')
labels = {
'name': _('Name'),

View File

@ -19,6 +19,7 @@
<form action="." method="post">
{% csrf_token %}
{{ form|crispy }}
<div id="ingredients-table"></div>
<br>
@ -84,6 +85,8 @@
}
});
// load initial value
$('#ingredients_data_input').val(JSON.stringify(data))
document.getElementById("new_empty").addEventListener("click", function () {
data.push({