Skip to content

Commit

Permalink
new conditional fill support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Sep 11, 2015
1 parent ebeea56 commit 8289bb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/quorum/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,14 @@ def get(cls, *args, **kwargs):

@classmethod
def find(cls, *args, **kwargs):
fields, eager, map, rules, meta, build, skip, limit, sort = cls._get_attrs(kwargs, (
fields, eager, map, rules, meta, build, fill, skip, limit, sort = cls._get_attrs(kwargs, (
("fields", None),
("eager", None),
("map", False),
("rules", True),
("meta", False),
("build", True),
("fill", True),
("skip", 0),
("limit", 0),
("sort", None)
Expand All @@ -493,7 +494,8 @@ def find(cls, *args, **kwargs):
limit = limit,
sort = sort
)
models = [cls.fill(cls.types(model)) for model in models]
models = [cls.types(model) for model in models]
if fill: models = [cls.fill(model) for model in models]
build and [cls.build(model, map = map, rules = rules, meta = meta) for model in models]
if eager: models = cls._eager(models, eager)
models = models if map else [cls.old(model = model, safe = False) for model in models]
Expand Down

0 comments on commit 8289bb2

Please sign in to comment.