def post_save(self, instance=None, **kwargs): """ create a file and add to the repository, if not already existing called via post_save signal """ data = getattr(instance, self.attname) key = self.get_key(instance) backend.commit(key, data.encode('utf-8'))
def post_save(self, instance=None, **kwargs): """ create a file and add to the repository, if not already existing called via post_save signal """ data = getattr(instance, self.attname) key = self.rcskey_format % (instance._meta.app_label, instance.__class__.__name__, self.attname, instance.id) try: backend.commit(key, data.encode("utf-8")) except: raise