Skip to content

Commit

Permalink
new model information
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Sep 11, 2015
1 parent 8289bb2 commit 0916033
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/quorum/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,14 @@ def singleton(

@classmethod
def get(cls, *args, **kwargs):
fields, eager, map, rules, meta, build, skip, limit, sort, raise_e = cls._get_attrs(kwargs, (
fields, eager, map, rules, meta, fill, build, skip, limit, sort, raise_e = 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 Down Expand Up @@ -456,8 +457,8 @@ def get(cls, *args, **kwargs):
raise exceptions.NotFoundError(message)
if not model and not raise_e: return model
cls.types(model)
cls.fill(model)
build and cls.build(model, map = map, rules = rules, meta = meta)
if fill: cls.fill(model)
if build: cls.build(model, map = map, rules = rules, meta = meta)
if eager: model = cls._eager(model, eager)
return model if map else cls.old(model = model, safe = False)

Expand Down Expand Up @@ -496,7 +497,7 @@ def find(cls, *args, **kwargs):
)
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 build: [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]
return models
Expand Down

0 comments on commit 0916033

Please sign in to comment.