Skip to content

Commit e662c39

Browse files
authored
Merge branch 'main' into patch-1
2 parents 9cec57e + 9d449a5 commit e662c39

File tree

4 files changed

+69
-71
lines changed

4 files changed

+69
-71
lines changed

.gitignore

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
# manage.py, always default to dev settings
2-
manage.py
3-
4-
# Django media files
5-
media/*
6-
7-
# Python bytecode:
1+
# Python
82
*.py[co]
9-
10-
# Packaging files:
113
*.egg*
12-
13-
# Sphinx docs:
4+
venv
5+
dist
146
build
157

168
# SQLite3 database files:
@@ -19,9 +11,6 @@ build
1911
# Logs:
2012
*.log
2113

22-
# Eclipse
23-
.project
24-
2514
# Linux Editors
2615
*~
2716
\#*\#
@@ -42,20 +31,5 @@ tramp
4231
Thumbs.db
4332
Desktop.ini
4433

45-
# Dev tools
46-
.idea
47-
.vagrant
48-
49-
# Ignore local configurations
50-
wrds/settings/local.py
51-
db.sqlite3
52-
53-
# Node modules
54-
node_modules/
55-
56-
# Bower components
57-
bower_components/
58-
5934
# Coverage
6035
htmlcov/
61-
.coverage

drf_excel/fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ def init_value(self, value):
141141
tzinfo=None
142142
)
143143
except:
144-
return value
144+
pass
145+
return value
145146

146147
def prep_cell(self, cell: Cell):
147148
super().prep_cell(cell)
@@ -161,7 +162,7 @@ def __init__(self, list_sep, **kwargs):
161162
def prep_value(self) -> Any:
162163
if self.value is None:
163164
return super().prep_value()
164-
elif len(self.value) > 0 and isinstance(self.value[0], Iterable):
165+
elif len(self.value) > 0 and isinstance(self.value[0], Iterable) and not isinstance(self.value[0], str):
165166
# array of array; write as json
166167
return json.dumps(self.value, ensure_ascii=False)
167168
else:

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[project]
2+
name = "drf-excel"
3+
authors = [{name = "Tim Allen", email = "[email protected]"},]
4+
description = "Django REST Framework renderer for Excel spreadsheet (xlsx) files."
5+
dynamic = ["version"]
6+
readme = "README.md"
7+
requires-python = ">=3.7"
8+
keywords = ["djangorestframework", "django rest framework", "excel", "spreadsheet", "rest", "restful", "api", "xls", "xlsx", "openpyxl"]
9+
license = {text = "BSD-3-Clause"}
10+
classifiers = [
11+
"Development Status :: 5 - Production/Stable",
12+
"Environment :: Web Environment",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: BSD License",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Framework :: Django",
25+
"Framework :: Django :: 3",
26+
"Framework :: Django :: 4",
27+
"Topic :: Internet :: WWW/HTTP",
28+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
29+
]
30+
dependencies = [
31+
"djangorestframework>=3.14",
32+
"openpyxl>=2.4",
33+
]
34+
35+
[project.optional-dependencies]
36+
dev = [
37+
"django-coverage-plugin",
38+
"ipython",
39+
"ruff",
40+
"pytest-coverage",
41+
"pytest-django",
42+
]
43+
44+
[project.urls]
45+
"Homepage" = "https://github.com/wharton/drf-excel/"
46+
"Repository" = "https://github.com/wharton/drf-excel/"
47+
"Documentation" = "https://github.com/wharton/drf-excel/"
48+
49+
[build-system]
50+
requires = ["setuptools>=67", "setuptools_scm>=7", "wheel"]
51+
build-backend = "setuptools.build_meta"
52+
53+
[tool.setuptools_scm]
54+
write_to = "drf_excel/_version.py"
55+
56+
[tool.pytest.ini_options]
57+
addopts = "--cov --cov-report=html"
58+
python_files = "tests.py test_*.py"
59+
DJANGO_SETTINGS_MODULE = "tests.settings"
60+
61+
[tool.coverage.run]
62+
plugins = ["django_coverage_plugin"]
63+
include = ["drf_excel/*"]

setup.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)