Tuesday, June 25, 2013

Re: delete file in GridFS by its id

Hi Hélio,

  I see that you've posted this question separately on each of the `django users`, `mongoengine users`, and `mongoengine developers`.

Please don't cross post questions on mailing lists - pick one appropriate mailing list and use that.  If you cross post questions there's every chance that other community members will spend time trying to help you out, without realizing that you've already resolved the issue in another thread on another list.  Posting to a single list is also more helpful for anyone else having the same issue later, as they can follow the replies in a single thread.

Also please keep in mind when posting to the lists that hundreds or thousands of people are going to spend a little bit of time reading and considering your questions.  The open source community tends to be very generous with its time, but cross-posting to multiple lists means you're demanding lots of attention to your questions, when just choosing the right list would mean that a smaller number of people would be able to consider your question and help you out.

This question is probably most appropriate for `mongoengine users`, so in this case just post there.

Many thanks,

  Tom


On Tuesday, 25 June 2013 10:38:08 UTC+1, Hélio Miranda wrote:
Hi
I have a problem that is how to delete a file from GridFS by its id.
I am using django and mongoengine.
To delete files of a certain record I'm doing this:

marmot = Animal.objects.get(id='51c80fb28774a715dc0481ae')
marmot.photo.delete()

Now just to delete a file by its id, was trying like this:

marmot = Animal.objects.get(id='51c86ae18774a70fec1a9fb7')
marmot.photo(id='51c86ae18774a70fec1a9fb5').delete()

But it gives me the following error: 'GridFSProxy' object is not callable
Someone can help me? What am I doing wrong?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate