You can keep the ModelForm just like the tutorial and override the "save"
method.
It will look something like this:
class MyForm(forms.ModelForm):
the_file = forms.FileField(required=True)
class Meta:
model = Person
fields = ('name', 'email', 'the_file')
def save(self, commit=True):
person = sup
i have 2 tables, 1 table contain the fields for name, email,
and I did another table with file, and date.
and I am trying to populate the 2 tables when a user submit the form.
I follow this amazing tutorial
https://amatellanes.wordpress.com/2013/11/05/dropzonejs-django-how-to-build-a-file-uplo
2 matches
Mail list logo