flywheel.models module¶
Model code
-
class
flywheel.models.
Model
(*args, **kwargs)[source]¶ Bases:
object
Base class for all flywheel models
For documentation on the metadata fields, check the attributes on the
ModelMetadata
class.Attributes: __metadata_class__
: classContainer for model metadata
- __metadata__ : dict
For details see Metadata
- meta_ :
ModelMetadata
The metadata for the model
- __engine__ :
Engine
Cached copy of the Engine that was used to save/load the model. This will be set after saving or loading a model.
- __dirty__ : set
The set of all immutable fields that have been changed since the last save operation.
- __cache__ : dict
The last seen value that was stored in the database. This is used to construct the
expects
dict when making updates that raise on conflict.- __incrs__ : dict
Mapping of fields to atomic add/delete operations for numbers and sets.
-
construct_ddb_expects_
(fields=None)[source]¶ Construct a dynamo “expects” mapping based on the cached fields