diff --git a/renderers.py b/renderers.py index 532e8bd..8ce1f67 100644 --- a/renderers.py +++ b/renderers.py @@ -44,15 +44,15 @@ def render_csv( model, list ): csv( *[ obj[col] for col in _cols] ) def render_json( model, list ): - json( list ) + json( list.read ) #def render_json( model, obj ): def render( opts, model, list ): # +format=json,xml,csv +json +tsv if ( 'json' in opts and opts['json'] ) or ( 'format' in opts and 'json' in opts['format'] ): render_json( model, list ) - if ( 'tsv' in opts and opts['tsv'] ) or ( 'format' in opts and 'tsv' in opts['format'] ): + elif ( 'tsv' in opts and opts['tsv'] ) or ( 'format' in opts and 'tsv' in opts['format'] ): render_tsv( model, list ) - if ( 'csv' in opts and opts['csv'] ) or ( 'format' in opts and 'csv' in opts['format'] ): + elif ( 'csv' in opts and opts['csv'] ) or ( 'format' in opts and 'csv' in opts['format'] ): render_csv( model, list ) - # if ( 'xml' in opts and opts['xml'] ) or ( 'format' in opts and 'xml' in opts['format'] ): + # elif ( 'xml' in opts and opts['xml'] ) or ( 'format' in opts and 'xml' in opts['format'] ): # render_xml( model, list )