#NEWLINE# def retrieve_maplight_contest_office( self , contest_office_id , id_maplight = None ) : #NEWLINE# #INDENT# error_result = False #NEWLINE# exception_does_not_exist = False #NEWLINE# exception_multiple_object_returned = False #NEWLINE# maplight_contest_office_on_stage = MapLightContestOffice ( ) #NEWLINE# try : #NEWLINE# #INDENT# if ( contest_office_id > 0 ) : #NEWLINE# #INDENT# maplight_contest_office_on_stage = MapLightContestOffice . objects . get ( id = contest_office_id ) #NEWLINE# contest_office_id = maplight_contest_office_on_stage . id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( id_maplight ) > 0 ) : #NEWLINE# #INDENT# maplight_contest_office_on_stage = MapLightContestOffice . objects . get ( contest_id = id_maplight ) #NEWLINE# contest_office_id = maplight_contest_office_on_stage . id #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except MapLightContestOffice . MultipleObjectsReturned as e : #NEWLINE# #INDENT# handle_record_found_more_than_one_exception ( e , logger = logger ) #NEWLINE# exception_multiple_object_returned = True #NEWLINE# #UNINDENT# except MapLightContestOffice . DoesNotExist as e : #NEWLINE# #INDENT# exception_does_not_exist = True #NEWLINE# #UNINDENT# results = { #NEWLINE# #INDENT# 'success' : ( True if ( contest_office_id > 0 ) else False ) , #NEWLINE# 'error_result' : error_result , #NEWLINE# 'DoesNotExist' : exception_does_not_exist , #NEWLINE# 'MultipleObjectsReturned' : exception_multiple_object_returned , #NEWLINE# 'maplight_contest_office_found' : ( True if ( contest_office_id > 0 ) else False ) , #NEWLINE# 'contest_office_id' : contest_office_id , #NEWLINE# 'maplight_contest_office' : maplight_contest_office_on_stage , #NEWLINE# #UNINDENT# } #NEWLINE# return results