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
This commit is contained in:
Adrian Holovaty 2005-12-12 03:56:42 +00:00
parent 82920f423d
commit 0309650237
1 changed files with 1 additions and 1 deletions

View File

@ -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.