Add crepes export-csv
command, for data export to CSV files
This commit is contained in:
parent
9d2411bccb
commit
83b1f93d99
3 changed files with 68 additions and 0 deletions
|
@ -105,6 +105,24 @@ class ExportCore(commands.ImportSubcommand):
|
|||
return kwargs
|
||||
|
||||
|
||||
class ExportCSV(commands.ExportFileSubcommand):
|
||||
"""
|
||||
Export data from CORE to CSV file(s)
|
||||
"""
|
||||
name = 'export-csv'
|
||||
description = __doc__.strip()
|
||||
default_handler_spec = 'rattail_corepos.corepos.importing.exporters:FromCoreToCSV'
|
||||
|
||||
def get_handler_factory(self, **kwargs):
|
||||
if self.config:
|
||||
spec = self.config.get('rattail_corepos.exporting', 'csv.handler',
|
||||
default=self.default_handler_spec)
|
||||
else:
|
||||
# just use default, for sake of cmd line help
|
||||
spec = self.default_handler_spec
|
||||
return load_object(spec)
|
||||
|
||||
|
||||
class ImportCore(ImportToCore):
|
||||
"""
|
||||
Import data from another CORE database
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue