﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34575	Storage Signals	Darrel O'Pry	nobody	"It would be nice if Storage emitted signals on file operations, so file related processes can be implemented without tight coupling. 

Use cases:

* purging files in CDNs
* generating derivative assets
* virus scanning

Proposed Signals:

* post_save
* post_delete


My initial thoughts on the implementation would be to modify Storage.delete to delegate to ._delete like .save and to put the signal triggering in .save and .delete. Alternatively, it could be implemented in a Mixin like we are doing in our project. 


{{{
storage_post_save = Signal()
storage_post_delete = Signal()


class SignalingStorageMixin:
    def save(self, name, content, max_length=None):
        super().save(name, content, max_length)
        # send a signal so we can react as files are uploaded in order to purge the cache.
        storage_post_save.send(sender=self.__class__, name=name)

    def delete(self, name):
        """"""
        Delete the specified file from the storage system.
        """"""
        super().delete(name)
        storage_post_delete.send(sender=self.__class__, name=name)
}}}



"	New feature	closed	File uploads/storage	4.2	Normal	wontfix	storage signals	Darrel O'Pry	Unreviewed	0	0	0	0	0	0
