#NEWLINE# def has_update_permission( self , item = None ) : #NEWLINE# #INDENT# user = self . api_request . user #NEWLINE# if item : #NEWLINE# #INDENT# obj = item . instance #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj = None #NEWLINE# #UNINDENT# opts = self . opts #NEWLINE# if ( opts . auto_created and hasattr ( self , 'parent_model' ) ) : #NEWLINE# #INDENT# for field in opts . fields : #NEWLINE# #INDENT# if ( field . rel and ( field . rel . to != self . parent_model ) ) : #NEWLINE# #INDENT# opts = field . rel . to . _meta #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return user . has_perm ( ( ( opts . app_label + '.' ) + opts . get_change_permission ( ) ) , obj )