Skip to content

Django storage details

Chris Seal edited this page Jul 26, 2024 · 1 revision

Storage base class implements a 'save' function that calls the protected 'self._save' function for the type of storage.

The S3Storage class creates a S3 bucket Object and uses the upload_fileobj command on the bucket Object.

Parameters defining the URL/Key/Secret Key and upload defaults are read from django.settings

The file_object.setter in MyTardis DFO, opens a File class object. This is a Django class that is tied to the storage class it's type is associated with. Once the File is open, then the self._storage.save() function will stream the File class object to the Storage save function, which in turn calls the self._save function defined in the storage.

MyTardis implements a StorageBox object on top of the Storage object, which holds the storage type and the attributes needed to initialise the Storage class

Clone this wiki locally