Files
freqsplit/api/api/forms.py
T
Joel Mathew Thomas 2608391608 refactor code dir
rename backend/ to api/, remove leftover dir ui/
2025-01-09 11:39:56 +05:30

13 lines
388 B
Python

from django import forms
class UploadFileForm(forms.Form):
file = forms.FileField(label='Select a file')
# You can add custom validation if needed
def clean_file(self):
file = self.cleaned_data.get('file')
if not file:
raise forms.ValidationError("No file uploaded!")
# Additional custom validations can be added here
return file