#NEWLINE# @ staticmethod #NEWLINE# def validate_metered_features( metered_features ) : #NEWLINE# #INDENT# product_codes = dict ( ) #NEWLINE# for mf in metered_features : #NEWLINE# #INDENT# if product_codes . get ( mf . product_code . value , None ) : #NEWLINE# #INDENT# err_msg = ( 'A plan cannot have two or more metered features with the same product code. (%s, %s)' % ( mf . name , product_codes . get ( metered_features . product_code . value ) ) ) #NEWLINE# raise ValidationError ( err_msg ) #NEWLINE# #UNINDENT# product_codes [ mf . product_code . value ] = mf . name