#NEWLINE# def format_posting( uuid , name , created_on = None , last_modified = None , details = None , book = None , priority = JobPriority . NORMAL ) : #NEWLINE# #INDENT# posting = { #NEWLINE# #INDENT# 'uuid' : uuid , #NEWLINE# 'name' : posting , #NEWLINE# 'priority' : priority . value , #NEWLINE# #UNINDENT# } #NEWLINE# if ( created_on is not None ) : #NEWLINE# #INDENT# posting [ 'created_on' ] = created_on #NEWLINE# #UNINDENT# if ( last_modified is not None ) : #NEWLINE# #INDENT# posting [ 'last_modified' ] = last_modified #NEWLINE# #UNINDENT# if details : #NEWLINE# #INDENT# posting [ 'details' ] = details #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# posting [ 'details' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( book is not None ) : #NEWLINE# #INDENT# posting [ 'book' ] = { #NEWLINE# #INDENT# 'name' : book . name , #NEWLINE# 'uuid' : book . uuid , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return posting