You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/index.rst
+42-23Lines changed: 42 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,24 +184,39 @@ Write up the view function for data export::
184
184
185
185
186
186
Then run the example again. Visit http://localhost:5000/import and upload `sample-data.xls <https://github.com/chfw/Flask-Excel/blob/master/sample-data.xls>`_ . Then visit http://localhost:5000/export to download the data back.
187
-
187
+
188
+
Export filtered query sets
189
+
-----------------------------
190
+
191
+
Previous example shows you how to dump one or more tables over http protocol. Hereby, let's look at how to turn a query sets into an excel sheet. You can
192
+
pass a query sets and an array of selected column names to :meth:`~flask_excel.make_response_from_query_sets` and generate an excel sheet from it::
:param field_name: same as :meth:`~flask_excel.ExcelRequest.get_sheet`
273
288
:param session: a SQLAlchemy session
274
-
:param table: a database table or a tuple which have this sequence (table, table_init_func, mapdict, name_columns_by_row, name_rows_by_column)
275
-
:param table_init_func: it is needed when your table had custom __init__ function
276
-
:param mapdict: it is needed when the uploaded sheet had a different column headers than the table column names this mapdict tells which column of the upload sheet maps to which column of the table
277
-
:param name_columns_by_row: uses the first row of the sheet to be column headers by default. if you use name_rows_by_column, please set this to -1
278
-
:param name_rows_by_column: uses a column to name rows.
279
-
:param keywords: additional keywords to pyexcel library
280
-
289
+
:param table: a database table
290
+
:param initializer: a custom table initialization function if you have one
291
+
:param mapdict: the explicit table column names if your excel data do not have the exact column names
292
+
:param keywords: additional keywords to :meth:`pyexcel.Sheet.save_to_database`
:param field_name: save as :meth:`~flask_excel.ExcelRequest.get_sheet`
285
-
:param session: a SQLAlchemy session
286
-
:param tables: a list of database tables or tuples which have this sequence (table, table_init_func, mapdict, name_columns_by_row, name_rows_by_column)
287
-
:param table_init_funcs: it is needed when your table had custom __init__ function
288
-
:param mapdict: it is needed when the uploaded sheet had a different column headers than the table column names. this mapdict tells which column of the upload sheet maps to which column of the table
289
-
:param name_columns_by_row: uses the first row of each sheet to be column headers by default. if you use name_rows_by_column, please set this to -1
290
-
:param name_rows_by_column: uses a column to name rows.
291
-
:param keywords: additional keywords to pyexcel library
297
+
:param session: a SQLAlchemy sessio
298
+
:param tables: a list of database tables
299
+
:param initializers: a list of model initialization functions.
300
+
:param mapdicts: a list of explicit table column names if your excel data sheets do not have the exact column names
301
+
:param keywords: additional keywords to :meth:`pyexcel.Book.save_to_database`
0 commit comments