3👍
✅
Add a hidden field to your ModelForm
that will hold the date:
class hostCreateForm(forms.ModelForm):
class Meta:
model = filled
widgets = {
'user': forms.HiddenInput()
}
# additional hidden field
datetime = forms.DatetimeField(widget=forms.HiddenInput)
You can then assign it a value in the javascript.
Source:stackexchange.com