> Hi, I have defined delete() method in my model. I use it to clear cache and 
> delete thumbs. When I delete an element in admin, in it's details (edit 
> mode) cache is cleared and all thumbs are deleted.
> But, when i want to delete several elements at once - checking checkboxes on 
> the elements list - elements are deleted, but cahce and 
> thumbnails aren't deleted, so my model delete method isn't made:/
> 
> How can I fix it?

When deleting batches of elements using whole querysets (which is what
I believe happens here), the delete() method isn't called for each
element, instead a more direct SQL query is issued to delete all
matching objects at once.

If you want to circumvent this, I recommend reading through
http://docs.djangoproject.com/en/1.2/topics/db/queries/#deleting-objects

Michal Petrucha

Attachment: signature.asc
Description: Digital signature

Reply via email to