From 030965023732eab0d7e47eb71f05b93cea6fed59 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 12 Dec 2005 03:56:42 +0000 Subject: [PATCH] magic-removal: Changed Model.delete() not to use get_model_module() git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1605 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 19852f7925..9ad81814bb 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -1020,7 +1020,7 @@ class Model: file_name = getattr(self, 'get_%s_filename' % f.name)() # If the file exists and no other object of this type references it, # delete it from the filesystem. - if os.path.exists(file_name) and not self._meta.get_model_module().get_list(**{'%s__exact' % f.name: getattr(self, f.name)}): + if os.path.exists(file_name) and not self.objects.get_list(**{'%s__exact' % f.name: getattr(self, f.name)}): os.remove(file_name) # Run any post-delete hooks.