Save Strategies

class mogwai.properties.strategy.SaveAlways

Save this value every time the corresponding model is saved.

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Save this value every time the corresponding model is saved.

Return type:bool
class mogwai.properties.strategy.SaveOnChange

Only save this value if it has changed.

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Always save this value if it has changed

Return type:bool
class mogwai.properties.strategy.SaveOnDecrease

Save this value only if it is decreasing

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Only save this value if it is decreasing

Return type:bool
class mogwai.properties.strategy.SaveOnIncrease

Save this value only if it is increasing

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Only save this value if it is increasing

Return type:bool
class mogwai.properties.strategy.SaveOnce

Only save this value once. If it changes throw an exception.

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Always save this value if it has changed

Raises:SaveStrategyException
Return type:bool
class mogwai.properties.strategy.Strategy

Saving strategies for mogwai. These are used to indicate when a property should be saved after the initial vertex/edge creation.

classmethod condition(previous_value, value, has_changed=False, first_save=False, graph_property=None)

Default save strategy condition

Raises:NotImplementedError