FileStore#

class trytond.filestore.FileStore#

Store and retrieve files from the directory defined in the configuration path of database section.

It uses a two levels of directory composed of the 2 chars of the file hash. It is an append only storage.

FileStore.get(id[, prefix])#

Retrieve the content of the file referred by the id in the prefixed directory.

FileStore.getmany(ids[, prefix])#

Retrieve a list of contents for the sequence of ids.

FileStore.size(id[, prefix])#

Return the size of the file referred by the id in the prefixed directory.

FileStore.sizemany(ids[, prefix])#

Return a list of sizes for the sequence of ids.

FileStore.set(data[, prefix])#

Store the data in the prefixed directory and return the identifiers.

FileStore.setmany(data[, prefix])#

Store the sequence of data and return a list of identifiers.

Note

The class can be overridden by setting a fully qualified name of a alternative class defined in the configuration class of the database section.