Thanks Russ.
That makes sense of course in the bigger picture.
I was living in my own little use-case.  :-)




On Thu, Oct 24, 2013 at 8:00 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

>
> On Thu, Oct 24, 2013 at 4:32 PM, Timothy W. Cook <t...@mlhim.org> wrote:
>
>> When I delete an object that has a FileField I expected that the
>> associated file would also be removed.  But alas, this doesn't happen.  At
>> least not through the admin interface.
>>
>> Is there something I am missing?
>>
>
> This is by design. After all, there's no guarantee that FileField
> references to files on disk are unique -- so if one model instance has a
> reference to a file, and you delete the model instance, there might still
> be other model instances that have references to that file.
>
> If you want to delete files from disk on cleanup, you can do this by
> customising the delete() method on your model. [1]
>
> [1]
> https://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods
>
> Yours,
> Russ Magee %-)
>
> --
> 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+unsubscr...@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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJxq84861Q7jqPwMGk5ATSztRgn5txjxR3xk5WtU9upBcbYBXg%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

-- 
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+unsubscr...@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3X41sAdP6yXbpXu0TXPr21z7k6jco5Dg0pqS-SK465ELw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to