diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 12:56:15 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-20 12:56:15 -0700 |
commit | 49dc8c327da6615de5179f4d50a05b61861448e8 (patch) | |
tree | f08b3ef75e14177769e1f4ad4ff71c7f36d888da | |
parent | 4204071d70f3fc36fbbe366a794f408278fa5680 (diff) | |
download | fatcat-49dc8c327da6615de5179f4d50a05b61861448e8.tar.gz fatcat-49dc8c327da6615de5179f4d50a05b61861448e8.zip |
WIP
-rw-r--r-- | fatcat/models.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fatcat/models.py b/fatcat/models.py index 24faee91..de913147 100644 --- a/fatcat/models.py +++ b/fatcat/models.py @@ -14,7 +14,7 @@ possible refactors: import json import hashlib -from marshmallow import post_dump +from marshmallow import post_dump, pre_load from fatcat import db, ma @@ -287,7 +287,7 @@ class ExtraJsonSchema(ma.ModelSchema): raw = data.pop('json') data.update(json.loads(raw)) - @post_dump(pass_many=False) + @pre_load(pass_many=False) def flatten(self, data): raw = json.dumps(data, indent=None) for k in list(data.keys()): @@ -342,6 +342,7 @@ class WorkEditSchema(ma.ModelSchema): class Meta: model = WorkEdit +work_rev_schema = WorkRevSchema() work_schema = WorkSchema() work_edit_schema = WorkEditSchema() |