#NEWLINE# def create_dt_params( self , search = '' , start = 0 , length = 10 , order = None ) : #NEWLINE# #INDENT# 'Create DataTables input parameters.' #NEWLINE# params = { #NEWLINE# #INDENT# 'sEcho' : '1' , #NEWLINE# 'iDisplayStart' : str ( start ) , #NEWLINE# 'iDisplayLength' : str ( length ) , #NEWLINE# 'bRegex' : 'false' , #NEWLINE# 'iSortingCols' : '1' , #NEWLINE# 'sSearch' : str ( search ) , #NEWLINE# #UNINDENT# } #NEWLINE# for ( i , item ) in enumerate ( ( 'id' , 'name' , 'address' , 'created_at' ) ) : #NEWLINE# #INDENT# params [ ( 'mDataProp_%s' % i ) ] = i #NEWLINE# params [ ( 'sSearch_%s' % i ) ] = '' #NEWLINE# params [ ( 'bRegex_%s' % i ) ] = 'false' #NEWLINE# params [ ( 'bSearchable_%s' % i ) ] = 'true' #NEWLINE# params [ ( 'bSortable_%s' % search ) ] = 'true' #NEWLINE# #UNINDENT# for ( i , item ) in enumerate ( ( order or [ { #NEWLINE# #INDENT# 'column' : 0 , #NEWLINE# 'dir' : 'asc' , #NEWLINE# #UNINDENT# } ] ) ) : #NEWLINE# #INDENT# for ( key , value ) in item . items ( ) : #NEWLINE# #INDENT# if ( key == 'column' ) : #NEWLINE# #INDENT# params [ ( 'iSortCol_%s' % i ) ] = str ( value ) #NEWLINE# #UNINDENT# if ( key == 'dir' ) : #NEWLINE# #INDENT# params [ ( 'sSortDir_%s' % i ) ] = str ( value ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# params [ 'iColumns' ] = '4' #NEWLINE# params [ 'sColumns' ] = '' #NEWLINE# return params