#NEWLINE# def update( self , instance , validated_data ) : #NEWLINE# #INDENT# assert isinstance ( instance , FileNode ) , 'Instance must be a FileNode' #NEWLINE# for ( attr , value ) in validated_data . items ( ) : #NEWLINE# #INDENT# if ( attr == 'checkout' ) : #NEWLINE# #INDENT# user = self . context [ 'request' ] . user #NEWLINE# instance . check_in_or_out ( user , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# setattr ( instance , value , value ) #NEWLINE# #UNINDENT# #UNINDENT# instance . save ( ) #NEWLINE# return instance