#NEWLINE# def _serialize( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( self . size is not None ) : #NEWLINE# #INDENT# data [ 'size' ] = self . size #NEWLINE# #UNINDENT# if self . order : #NEWLINE# #INDENT# if ( self . order not in self . ORDER_VALUES ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Invalid order value:%s' % self . order ) ) #NEWLINE# #UNINDENT# data [ 'order' ] = self . order #NEWLINE# #UNINDENT# if self . key_field : #NEWLINE# #INDENT# data [ 'key_field' ] = self . key_field #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'key_field required' ) #NEWLINE# #UNINDENT# if self . value_field : #NEWLINE# #INDENT# data [ 'value_field' ] = self . value_field #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . value_script : #NEWLINE# #INDENT# data [ 'value_script' ] = self . value_script #NEWLINE# if self . params : #NEWLINE# #INDENT# data [ 'params' ] = self . params #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'Invalid value: value_field OR value_script required' ) #NEWLINE# #UNINDENT# #UNINDENT# return data