Skip to content

Commit 96c69c9

Browse files
committed
📚 update documentation . #65
1 parent b153e8a commit 96c69c9

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.moban.d/docs/source/django-index.rst.jj2

+8-2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ into the following data models:
127127
.. note::
128128
Except the added "slug" field, **Question** and **Choice** are copied from Django tutorial part 1.
129129

130+
.. note::
131+
Please also pay attention to 'choice' sheet. There exists an arbitrary column: "Noise", which
132+
exists to show case skipping column feature using mapdicts later.
133+
130134
Please visit this link http://localhost:8000/polls/import/, you shall see this upload form:
131135

132136
.. image:: import-page.png
@@ -168,15 +172,17 @@ The star is :meth:`~django_excel.save_book_to_database`. The parameter **models*
168172
should be a list of django models. **initializers** is a list of initialization
169173
functions for each model. In the example, we do not have init function for Question
170174
so 'None' is given and `choice_func` is given to Choice. **mapdicts** is a list of
171-
column names for each model. The member of the **mapdicts** can be a dictionary
172-
as well::
175+
column names for each model and the member of the **mapdicts** can be a dictionary::
173176

174177
{
175178
"Question Text": "question_text",
176179
"Publish Date": "pub_date",
177180
"Unique Identifier": "slug"
178181
}
179182

183+
As a dictionary, it can be used to skip columns in the incoming sheets. For example,
184+
'Noise' column is skipped because it was not mentioned in the mapdict.
185+
180186
The custom initialization function is needed when the data from the excel sheet
181187
needs translation before data import. For example, **Choice** has a foreign
182188
key to **Question**. When choice data are to be imported, "Question" column

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ django-excel - Let you focus on data, instead of file formats
1919

2020

2121
.. image:: https://pepy.tech/badge/django-excel/month
22-
:target: https://pepy.tech/project/django-excel/month
22+
:target: https://pepy.tech/project/django-excel
2323

2424

2525
.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg

docs/source/index.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ into the following data models:
364364
.. note::
365365
Except the added "slug" field, **Question** and **Choice** are copied from Django tutorial part 1.
366366

367+
.. note::
368+
Please also pay attention to 'choice' sheet. There exists an arbitrary column: "Noise", which
369+
exists to show case skipping column feature using mapdicts later.
370+
367371
Please visit this link http://localhost:8000/polls/import/, you shall see this upload form:
368372

369373
.. image:: import-page.png
@@ -405,15 +409,17 @@ The star is :meth:`~django_excel.save_book_to_database`. The parameter **models*
405409
should be a list of django models. **initializers** is a list of initialization
406410
functions for each model. In the example, we do not have init function for Question
407411
so 'None' is given and `choice_func` is given to Choice. **mapdicts** is a list of
408-
column names for each model. The member of the **mapdicts** can be a dictionary
409-
as well::
412+
column names for each model and the member of the **mapdicts** can be a dictionary::
410413

411414
{
412415
"Question Text": "question_text",
413416
"Publish Date": "pub_date",
414417
"Unique Identifier": "slug"
415418
}
416419

420+
As a dictionary, it can be used to skip columns in the incoming sheets. For example,
421+
'Noise' column is skipped because it was not mentioned in the mapdict.
422+
417423
The custom initialization function is needed when the data from the excel sheet
418424
needs translation before data import. For example, **Choice** has a foreign
419425
key to **Question**. When choice data are to be imported, "Question" column

0 commit comments

Comments
 (0)