#NEWLINE# def create_under_limit_stmt_result( stmt_set , stored , language , format ) : #NEWLINE# #INDENT# stmt_result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if stmt_set : #NEWLINE# #INDENT# stmt_set = Statement . objects . select_related ( 'actor' , 'verb' , 'context_team' , 'context_instructor' , 'authority' , 'object_agent' , 'object_activity' , 'object_substatement' ) . prefetch_related ( 'context_ca_parent' , 'context_ca_grouping' , 'context_ca_category' , 'context_ca_other' ) . filter ( ( Q ( statement_id__in = stmt_set ) & Q ( voided = False ) ) ) . distinct ( ) #NEWLINE# if ( format == 'exact' ) : #NEWLINE# #INDENT# stmt_result = ( '{"statements": [%s], "more": ""}' % ',' . join ( [ json . dumps ( stmt . full_statement , sort_keys = False ) for stmt in stmt_set . order_by ( stored ) ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stmt_result [ 'statements' ] = [ stmt . to_dict ( language , format ) for stmt in stmt_set . order_by ( stmt_result ) ] #NEWLINE# stmt_result [ 'more' ] = '' #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# stmt_result [ 'statements' ] = [ ] #NEWLINE# stmt_result [ 'more' ] = '' #NEWLINE# #UNINDENT# return stmt_result