From e3f960aa8b4436a857dea12d194caacb3750adb1 Mon Sep 17 00:00:00 2001 From: yiorgos marinellis Date: Tue, 17 Mar 2020 23:36:27 +0100 Subject: [PATCH] Add ProofFunction view except author field --- ereuse_devicehub/resources/proof/models.py | 2 +- ereuse_devicehub/resources/proof/schemas.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/resources/proof/models.py b/ereuse_devicehub/resources/proof/models.py index 13b81cc9..4aa4f2fa 100644 --- a/ereuse_devicehub/resources/proof/models.py +++ b/ereuse_devicehub/resources/proof/models.py @@ -112,7 +112,7 @@ class ProofDataWipe(JoinedTableMixin, Proof): class ProofFunction(JoinedTableMixin, Proof): disk_usage = Column(db.Integer, default=0) - rate_id = Column(UUID, ForeignKey(Rate.id), nullable=False) + rate_id = Column(UUID(as_uuid=True), ForeignKey(Rate.id), nullable=False) rate = relationship(Rate, backref=backref('proof_function', lazy=True, diff --git a/ereuse_devicehub/resources/proof/schemas.py b/ereuse_devicehub/resources/proof/schemas.py index 16a833b7..26479e50 100644 --- a/ereuse_devicehub/resources/proof/schemas.py +++ b/ereuse_devicehub/resources/proof/schemas.py @@ -45,8 +45,9 @@ class ProofDataWipe(Proof): class ProofFunction(Proof): __doc__ = m.ProofFunction.__doc__ - disk_usage = Integer() - rate = NestedOn(s_action.Rate, required=True, only_query='id') + disk_usage = Integer(data_key='diskUsage') + rate = NestedOn(s_action.Rate, required=True, + only_query='id', data_key='rateID') class ProofReuse(Proof):