Added module renderers json tsv csv xml
This commit is contained in:
parent
b689d71c22
commit
a393db91a3
|
@ -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 opts.json or ( opts.format and 'json' in opts.format ):
|
||||
if ( hasattr(opts, 'json') and opts.json ) or ( opts.format and 'json' in opts.format ):
|
||||
render_json( model, list )
|
||||
if opts.tsv or ( opts.format and 'tsv' in opts.format ):
|
||||
if ( hasattr(opts, 'tsv') and opts.tsv ) or ( opts.format and 'tsv' in opts.format ):
|
||||
render_tsv( model, list )
|
||||
if opts.csv or ( opts.format and 'csv' in opts.format ):
|
||||
if ( hasattr(opts, 'csv') and opts.csv ) or ( opts.format and 'csv' in opts.format ):
|
||||
render_csv( model, list )
|
||||
# if opts.xml or ( opts.format and 'xml' in opts.format ):
|
||||
# if ( hasattr(opts, 'xml') and opts.xml ) or ( opts.format and 'xml' in opts.format ):
|
||||
# render_xml( model, list )
|
||||
|
|
Loading…
Reference in New Issue