#NEWLINE# def exists( self , name ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# storage_attrs = self . _get_storage_attributes ( name ) #NEWLINE# #UNINDENT# except NameException : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# model_class_path = storage_attrs [ 'model_class_path' ] #NEWLINE# filename_field = storage_attrs [ 'filename_field' ] #NEWLINE# model_cls = self . _get_model_cls ( model_class_path ) #NEWLINE# return model_cls . objects . filter ( ** { #NEWLINE# #INDENT# filename_field : name , #NEWLINE# #UNINDENT# } ) . exists ( )