#NEWLINE# @ property #NEWLINE# def shipping_status( self ) : #NEWLINE# #INDENT# 'Return the last complete shipping event for this order.' #NEWLINE# events = self . shipping_events . order_by ( '-date_created' , '-pk' ) . all ( ) #NEWLINE# if ( not len ( events ) ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# event_map = OrderedDict ( ) #NEWLINE# for event in events : #NEWLINE# #INDENT# event_name = event . event_type . name #NEWLINE# if ( event_name not in event_map ) : #NEWLINE# #INDENT# event_map [ event_name ] = [ ] #NEWLINE# #UNINDENT# event_map [ event_name ] . extend ( list ( event . line_quantities . all ( ) ) ) #NEWLINE# #UNINDENT# status = _ ( 'In progress' ) #NEWLINE# for ( event_name , event_line_quantities ) in event_map . items ( ) : #NEWLINE# #INDENT# if self . _is_event_complete ( status ) : #NEWLINE# #INDENT# return event_name #NEWLINE# #UNINDENT# #UNINDENT# return status