#NEWLINE# def set_tenant_attr( self , obj , prop_name , value ) : #NEWLINE# #INDENT# value = self . try_intrinsic_function ( value ) #NEWLINE# if value : #NEWLINE# #INDENT# attrs = TenantAttribute . objects . filter ( tenant = obj , name = prop_name ) #NEWLINE# if attrs : #NEWLINE# #INDENT# attr = attrs [ 0 ] #NEWLINE# if ( attr . value != value ) : #NEWLINE# #INDENT# self . info ( ( 'updating attribute %s' % prop_name ) ) #NEWLINE# attr . value = value #NEWLINE# attr . save ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . info ( ( 'adding attribute %s' % prop_name ) ) #NEWLINE# ta = TenantAttribute ( tenant = obj , name = prop_name , value = value ) #NEWLINE# ta . save ( )