#NEWLINE# @ property #NEWLINE# def activities( self ) : #NEWLINE# #INDENT# "A immutable dict of all the user's activities by lang." #NEWLINE# if ( not hasattr ( d , '_activity_cache' ) ) : #NEWLINE# #INDENT# self . _activity_cache = d = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# activities = _UserActivity . query . filter_by ( user = self ) . all ( ) #NEWLINE# for activity in activities : #NEWLINE# #INDENT# d [ activity . locale ] = activity #NEWLINE# #UNINDENT# #UNINDENT# return ImmutableDict ( self . _activity_cache )