class documentation

Standard filesystem storage

Method __init__ Undocumented
Method delete Delete the specified file from the storage system.
Method exists Return True if a file referenced by the given name already exists in the storage system, or False if the name is available for a new file.
Method get_accessed_time Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Method get_created_time Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Method get_modified_time Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.
Method listdir List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.
Method path Return a local filesystem path where the file can be retrieved using Python's built-in open() function. Storage systems that can't be accessed using open() should *not* implement this method.
Method size Return the total size, in bytes, of the file specified by name.
Method url Return an absolute URL where the file's contents can be accessed directly by a web browser.
Constant OS_OPEN_FLAGS Undocumented
Property base_location Undocumented
Property base_url Undocumented
Property directory_permissions_mode Undocumented
Property file_permissions_mode Undocumented
Property location Undocumented
Method _clear_cached_properties Reset setting based property values.
Method _datetime_from_timestamp If timezone support is enabled, make an aware datetime object in UTC; otherwise make a naive one in the local timezone.
Method _ensure_location_group_id Undocumented
Method _open Undocumented
Method _save Undocumented
Method _value_or_setting Undocumented
Instance Variable _base_url Undocumented
Instance Variable _directory_permissions_mode Undocumented
Instance Variable _file_permissions_mode Undocumented
Instance Variable _location Undocumented

Inherited from Storage:

Method generate_filename Validate the filename by calling get_valid_name() and return a filename to be passed to the save() method.
Method get_alternative_name Return an alternative filename, by adding an underscore and a random 7 character alphanumeric string (before the file extension, if one exists) to the filename.
Method get_available_name Return a filename that's free on the target storage system and available for new content to be written to.
Method get_valid_name Return a filename, based on the provided filename, that's suitable for use in the target storage system.
Method open Retrieve the specified file from storage.
Method save Save new content to the file specified by name. The content should be a proper File object or any Python file-like object, ready to be read from the beginning.
def __init__(self, location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None): (source)
def delete(self, name): (source)

Delete the specified file from the storage system.

def exists(self, name): (source)

Return True if a file referenced by the given name already exists in the storage system, or False if the name is available for a new file.

def get_accessed_time(self, name): (source)

Return the last accessed time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

def get_created_time(self, name): (source)

Return the creation time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

def get_modified_time(self, name): (source)

Return the last modified time (as a datetime) of the file specified by name. The datetime will be timezone-aware if USE_TZ=True.

def listdir(self, path): (source)

List the contents of the specified path. Return a 2-tuple of lists: the first item being directories, the second item being files.

def path(self, name): (source)

Return a local filesystem path where the file can be retrieved using Python's built-in open() function. Storage systems that can't be accessed using open() should *not* implement this method.

def size(self, name): (source)

Return the total size, in bytes, of the file specified by name.

def url(self, name): (source)

Return an absolute URL where the file's contents can be accessed directly by a web browser.

OS_OPEN_FLAGS = (source)

Undocumented

Value
((os.O_WRONLY|os.O_CREAT)|os.O_EXCL)|getattr(os, 'O_BINARY', 0)

Undocumented

@cached_property
directory_permissions_mode = (source)

Undocumented

@cached_property
file_permissions_mode = (source)

Undocumented

def _clear_cached_properties(self, setting, **kwargs): (source)

Reset setting based property values.

def _datetime_from_timestamp(self, ts): (source)

If timezone support is enabled, make an aware datetime object in UTC; otherwise make a naive one in the local timezone.

def _ensure_location_group_id(self, full_path): (source)

Undocumented

def _open(self, name, mode='rb'): (source)

Undocumented

def _save(self, name, content): (source)

Undocumented

def _value_or_setting(self, value, setting): (source)

Undocumented

_base_url = (source)

Undocumented

_directory_permissions_mode = (source)

Undocumented

_file_permissions_mode = (source)

Undocumented

_location = (source)

Undocumented