Skip to content

Commit ae12a2c

Browse files
committed
update documentation about auto import
1 parent a17d5d4 commit ae12a2c

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

README.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ well as on file system. This library can turn the excel data into a list of list
1717
a list of records(dictionaries), dictionaries of lists. And vice versa. Hence it
1818
lets you focus on data in Django based web development, instead of file formats.
1919

20-
The idea originated from the problem of the illiteracy of excel file formats of
21-
non-technical office workers: such as office assistant, human resource administrator.
22-
There is nothing with the un-deniable fact that some people do not know the
23-
difference among various excel formats. It becomes usability problem to those
24-
people when a web service cannot parse the excel file that they saved using
25-
Microsoft Excel. Instead of training those people about file formats, this library
26-
helps web developers to handle most of the excel file formats by unifying the
27-
programming interface to most of the excel readers and writers.
20+
The idea originated from the common usability problem when developing an excel file
21+
driven web applications for non-technical office workers: such as office assistant,
22+
human resource administrator. It is an un-deniable fact that not all people know the
23+
difference among various excel formats: csv, xls, xlsx. Instead of training those people
24+
about file formats, this library helps web developers to handle most of the excel file
25+
formats by providing a common programming interface.
26+
27+
.. note::
28+
Here is a typical conversation between the developer and the user::
29+
30+
User: "I have uploaded an excel file as instructed, but your application says un-supported file format"
31+
Developer: "Did you upload an xlsx file or a csv file?"
32+
User: "Well, I am not sure. I saved the data using Microsoft Excel. Surely, it must be in an excel format."
2833

2934
The highlighted features are:
3035

@@ -46,7 +51,7 @@ The highlighted features are:
4651
`pyexcel-xlsx`_ xlsx
4752
`pyexcel-ods3`_ ods (python 2.6, 2.7, 3.3, 3.4)
4853
`pyexcel-ods`_ ods (python 2.6, 2.7)
49-
`pyexcel-text`_ (write only)json, rst, mediawiki,
54+
`pyexcel-text`_ (write only)json, rst, mediawiki, html
5055
latex, grid, pipe, orgtbl, plain simple
5156
================ ========================================
5257

doc/source/index.rst

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ well as on file system. This library can turn the excel data into a list of list
1818
a list of records(dictionaries), dictionaries of lists. And vice versa. Hence it
1919
lets you focus on data in Django based web development, instead of file formats.
2020

21-
The idea originated from the problem of the illiteracy of excel file formats of
22-
non-technical office workers: such as office assistant, human resource administrator.
23-
There is nothing with the un-deniable fact that some people do not know the
24-
difference among various excel formats. It becomes usability problem to those
25-
people when a web service cannot parse the excel file that they saved using
26-
Microsoft Excel. Instead of training those people about file formats, this library
27-
helps web developers to handle most of the excel file formats by unifying the
28-
programming interface to most of the excel readers and writers.
21+
The idea originated from the common usability problem when developing an excel file
22+
driven web applications for non-technical office workers: such as office assistant,
23+
human resource administrator. It is an un-deniable fact that not all people know the
24+
difference among various excel formats: csv, xls, xlsx. Instead of training those people
25+
about file formats, this library helps web developers to handle most of the excel file
26+
formats by providing a common programming interface.
27+
28+
.. note::
29+
Here is a typical conversation between the developer and the user::
30+
31+
User: "I have uploaded an excel file as instructed, but your application says un-supported file format"
32+
Developer: "Did you upload an xlsx file or a csv file?"
33+
User: "Well, I am not sure. I saved the data using Microsoft Excel. Surely, it must be in an excel format."
2934

3035
The highlighted features are:
3136

@@ -47,7 +52,7 @@ The highlighted features are:
4752
`pyexcel-xlsx`_ xlsx
4853
`pyexcel-ods3`_ ods (python 2.6, 2.7, 3.3, 3.4)
4954
`pyexcel-ods`_ ods (python 2.6, 2.7)
50-
`pyexcel-text`_ (write only)json, rst, mediawiki,
55+
`pyexcel-text`_ (write only)json, rst, mediawiki, html
5156
latex, grid, pipe, orgtbl, plain simple
5257
================ ========================================
5358

@@ -104,14 +109,15 @@ You will need to update your *settings.py*::
104109
More excel file formats
105110
------------------------
106111

107-
The example application understands csv, tsv and its zipped variants: csvz and tsvz. If you would like to expand the list of supported excel file formats (see :ref:`file-format-list`) for your own application, you could include one or all of the following import lines right after **django-excel** is imported::
112+
The example application understands csv, tsv and its zipped variants: csvz and tsvz. If you would like to expand the list of supported excel file formats (see :ref:`file-format-list`) for your own application, you could install one or all of the following::
108113

109-
import pyexcel.ext.xls # pip install pyexcel-xls
110-
import pyexcel.ext.xlsx # pip install pyexcel-xlsx
111-
import pyexcel.ext.ods # pip install pyexcel-ods
114+
pip install pyexcel-xls
115+
pip install pyexcel-xlsx
116+
pip install pyexcel-ods
112117

113-
.. note::
118+
.. warning::
114119

120+
If you are using pyexcel <=0.2.1, you still need to import each plugin manually, e.g. `import pyexcel.ext.xls` and
115121
Your IDE or pyflakes may highlight it as un-used but it is used. The registration of
116122
the extra file format support happens when the import action is performed
117123

polls/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
from django.template import RequestContext
55
import django_excel as excel
66
from polls.models import Question, Choice
7-
import pyexcel.ext.xls
7+
8+
# No longer you need the following import statements if you use pyexcel >=0.2.2
9+
import pyexcel.ext.xls
810
import pyexcel.ext.xlsx
911
import pyexcel.ext.ods3
1012

0 commit comments

Comments
 (0)