1. David Larlet
  2. django-storages

Issues

Issue #72 resolved

[mongodb] delete() can not delete GridFS file

Mitsukuni Sato
created an issue

PyMongo's GridFS class thru filename when calling delete(). This method needs value of 'ObjectID'. I fixed up a code. see below::

{{{

!diff

--- mongodb.py-orig 2011-02-27 22:32:37.000000000 +0900 +++ mongodb.py 2011-02-27 22:32:47.000000000 +0900 @@ -48,7 +48,8 @@ return force_unicode(name).strip().replace('\', '/')

 def delete(self, name):
  • return self.fs.delete(name)
  • f = self._open(name, 'r')
  • return self.fs.delete(f.file._id)

    def exists(self, name): try: }}}