<s> """<STR_LIT>""" <EOL> from pyramid . response import Response <EOL> from pyramid . view import view_config <EOL> from string import upper <EOL> from sqlalchemy . exc import DBAPIError <EOL> from datatables import ColumnDT , DataTables <EOL> from . models import ( <EOL> DBSession , <EOL> User , <EOL> Address , <EOL> ) <EOL> @ view_config ( route_name = '<STR_LIT>' , renderer = '<STR_LIT>' ) <EOL> def home ( request ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> DBSession . query ( User ) . first ( ) <EOL> except DBAPIError : <EOL> return Response ( <EOL> conn_err_msg , content_type = '<STR_LIT>' , status_int = <NUM_LIT> ) <EOL> return { '<STR_LIT>' : '<STR_LIT>' } <EOL> @ view_config ( route_name = '<STR_LIT>' , renderer = '<STR_LIT>' ) <EOL> def dt_19x ( request ) : <EOL> """<STR_LIT>""" <EOL> return { '<STR_LIT>' : '<STR_LIT>' } <EOL> @ view_config ( route_name = '<STR_LIT>' , renderer = '<STR_LIT>' ) <EOL> def dt_110x ( request ) : <EOL> """<STR_LIT>""" <EOL> return { '<STR_LIT>' : '<STR_LIT>' } <EOL> @ view_config ( route_name = '<STR_LIT:data>' , renderer = '<STR_LIT>' ) <EOL> def data ( request ) : <EOL> """<STR_LIT>""" <EOL> columns = [ ] <EOL> columns . append ( ColumnDT ( '<STR_LIT:id>' ) ) <EOL> columns . append ( ColumnDT ( '<STR_LIT:name>' , filter = upper ) ) <EOL> columns . append ( ColumnDT ( '<STR_LIT>' ) ) <EOL> columns . append ( ColumnDT ( '<STR_LIT>' ) ) <EOL> query = DBSession . query ( User ) . join ( Address ) . filter ( Address . id > <NUM_LIT> ) <EOL> rowTable = DataTables ( request . GET , User , query , columns ) <EOL> return rowTable . output_result ( ) <EOL> conn_err_msg = """<STR_LIT>""" </s>
