This commit is contained in:
DiG 2022-01-16 19:09:33 +01:00
parent a393db91a3
commit 67a3ad5578
1 changed files with 4 additions and 4 deletions

View File

@ -35,11 +35,11 @@ def render_json( model, list ):
#def render_json( model, obj ):
def render( opts, model, list ): # +format=json,xml,csv +json +tsv
if ( hasattr(opts, 'json') and opts.json ) or ( opts.format and 'json' in opts.format ):
if ( 'json' in opts and opts['json'] ) or ( 'format' in opts and 'json' in opts['format'] ):
render_json( model, list )
if ( hasattr(opts, 'tsv') and opts.tsv ) or ( opts.format and 'tsv' in opts.format ):
if ( 'tsv' in opts and opts['tsv'] ) or ( 'format' in opts and 'tsv' in opts['format'] ):
render_tsv( model, list )
if ( hasattr(opts, 'csv') and opts.csv ) or ( opts.format and 'csv' in opts.format ):
if ( 'csv' in opts and opts['csv'] ) or ( 'format' in opts and 'csv' in opts['format'] ):
render_csv( model, list )
# if ( hasattr(opts, 'xml') and opts.xml ) or ( opts.format and 'xml' in opts.format ):
# if ( 'xml' in opts and opts['xml'] ) or ( 'format' in opts and 'xml' in opts['format'] ):
# render_xml( model, list )