rattail.db.model.batch
¶
Core batch data models
Actually the classes in this module are not true models but rather are mixins, which provide the common columns etc. for batch tables.
- class rattail.db.model.batch.core.BatchMixin[source]¶
Mixin for all (new-style) batch classes.
- absolute_filepath(config, filename=None, name_attr='filename', makedirs=False)[source]¶
Return the absolute path where a data file resides.
- filedir(config)[source]¶
Returns the absolute path to the folder in which the data file resides. The config object determines the root path for such files, e.g.:
[rattail] batch.files = /path/to/batch/files
Within this root path, a more complete path is generated using the
BatchMixin.key
and theBatchMixin.uuid
values.
- filepath(config, filename=None, name_attr='filename', makedirs=False)¶
Return the absolute path where a data file resides.
- relative_filedir(config)[source]¶
Returns the path for batch data file storage, relative to the root folder for all batch storage. This includes the batch key as the first segment, e.g.
'labels/d4/83d6f2aeb011e6afeb3ca9f40bc550'
.
- relative_filepath(config)¶
Returns the path for batch data file storage, relative to the root folder for all batch storage. This includes the batch key as the first segment, e.g.
'labels/d4/83d6f2aeb011e6afeb3ca9f40bc550'
.
- class rattail.db.model.batch.core.BaseFileBatchMixin[source]¶
Common mixin for all batches which may involve a data file, either as initial data, or perhaps as “export” etc.
- class rattail.db.model.batch.core.FileBatchMixin[source]¶
Mixin for all (new-style) batch classes which involve a file upload as their first step.