Skip to content

Commit

Permalink
new initial keyword support for quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Feb 17, 2015
1 parent cd75b3b commit a994023
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/quorum/model.py
Expand Up @@ -635,10 +635,14 @@ def fill(cls, model = None):
if name in ("_id",): continue
increment = _definition.get("increment", False)
if increment: continue
_type = _definition.get("type")
default = TYPE_DEFAULTS.get(_type, None)
default = _type._default() if hasattr(_type, "_default") else default
model[name] = default
if "initial" in _definition:
initial = _definition["initial"]
model[name] = initial
else:
_type = _definition.get("type")
default = TYPE_DEFAULTS.get(_type, None)
default = _type._default() if hasattr(_type, "_default") else default
model[name] = default

return model

Expand Down

0 comments on commit a994023

Please sign in to comment.