#NEWLINE# def latest( self , field_name = None ) : #NEWLINE# #INDENT# "\n        Returns the latest object, according to the model's 'get_latest_by'\n        option or optional given field_name.\n        " #NEWLINE# latest_by = ( field_name or self . model . _meta . get_latest_by ) #NEWLINE# assert bool ( latest_by ) , "latest() requires either a field_name parameter or 'get_latest_by' in the model" #NEWLINE# self . query . order_by . append ( ( '-%s' % latest_by ) ) #NEWLINE# return self . iterator ( ) . next ( )