excel or ods format for upload datas
This commit is contained in:
parent
8ee3f561a4
commit
139cae7c87
BIN
examples/membership-card.ods
Normal file
BIN
examples/membership-card.ods
Normal file
Binary file not shown.
BIN
examples/membership-card.xls
Normal file
BIN
examples/membership-card.xls
Normal file
Binary file not shown.
|
@ -79,7 +79,8 @@ class ImportForm(forms.Form):
|
||||||
if File_datas.objects.filter(file_name=self.file_name, success=True).exists():
|
if File_datas.objects.filter(file_name=self.file_name, success=True).exists():
|
||||||
raise ValidationError("This file already exists!")
|
raise ValidationError("This file already exists!")
|
||||||
|
|
||||||
df = pd.read_csv (data, delimiter="\t", quotechar='"', quoting=csv.QUOTE_ALL)
|
# df = pd.read_csv (data, delimiter="\t", quotechar='"', quoting=csv.QUOTE_ALL)
|
||||||
|
df = pd.read_excel(data)
|
||||||
data_pd = df.fillna('').to_dict()
|
data_pd = df.fillna('').to_dict()
|
||||||
|
|
||||||
if not data_pd:
|
if not data_pd:
|
||||||
|
|
|
@ -6,6 +6,8 @@ black==23.9.1
|
||||||
python-decouple==3.8
|
python-decouple==3.8
|
||||||
jsonschema==4.19.1
|
jsonschema==4.19.1
|
||||||
pandas==2.1.1
|
pandas==2.1.1
|
||||||
|
xlrd==2.0.1
|
||||||
|
odfpy==1.4.1
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
didkit==0.3.2
|
didkit==0.3.2
|
||||||
jinja2==3.1.2
|
jinja2==3.1.2
|
||||||
|
|
Loading…
Reference in a new issue