diff --git a/examples/membership-card.ods b/examples/membership-card.ods new file mode 100644 index 0000000..adf3cfc Binary files /dev/null and b/examples/membership-card.ods differ diff --git a/examples/membership-card.xls b/examples/membership-card.xls new file mode 100644 index 0000000..857fb28 Binary files /dev/null and b/examples/membership-card.xls differ diff --git a/idhub/admin/forms.py b/idhub/admin/forms.py index 2649f4b..e67789e 100644 --- a/idhub/admin/forms.py +++ b/idhub/admin/forms.py @@ -79,7 +79,8 @@ class ImportForm(forms.Form): if File_datas.objects.filter(file_name=self.file_name, success=True).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() if not data_pd: diff --git a/requirements.txt b/requirements.txt index 9b19238..81df537 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,8 @@ black==23.9.1 python-decouple==3.8 jsonschema==4.19.1 pandas==2.1.1 +xlrd==2.0.1 +odfpy==1.4.1 requests==2.31.0 didkit==0.3.2 jinja2==3.1.2