Add basic docs for CSV download support in master view

This commit is contained in:
Lance Edgar 2018-05-29 12:38:37 -05:00
parent d03de66b64
commit 6c0f243655
2 changed files with 11 additions and 1 deletions

View file

@ -68,6 +68,11 @@ override when defining your subclass.
Factory callable to be used when creating new grid instances; defaults to
:class:`tailbone.grids.Grid`.
.. attribute:: MasterView.results_downloadable_csv
Flag indicating whether the view should allow CSV download of grid data,
i.e. primary search results.
.. attribute:: MasterView.help_url
If set, this defines the "default" help URL for all views provided by the
@ -85,4 +90,8 @@ subclass.
.. .. automethod:: MasterView.get_settings
.. automethod:: MasterView.get_csv_fields
.. automethod:: MasterView.get_csv_row
.. automethod:: MasterView.get_help_url

View file

@ -2076,7 +2076,8 @@ class MasterView(View):
def get_csv_fields(self):
"""
Return the list of fields to be written to CSV download.
Return the list of fields to be written to CSV download. Default field
list will be constructed from the underlying table columns.
"""
fields = []
mapper = orm.class_mapper(self.model_class)