From dc5d8fcbe0aa6622f22caf0c2f90cfc49f79872c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 10 May 2021 11:51:28 +0200 Subject: [PATCH] fixing representation classes --- ereuse_devicehub/resources/action/models.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index 71b8d2f9..b7989585 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1434,7 +1434,9 @@ class CancelReservation(Organize): class Confirm(JoinedTableMixin, ActionWithMultipleDevices): - """Users confirm the offer and change it to trade""" + """Users confirm the one action trade this confirmation it's link to trade + and the devices that confirm + """ user_id = db.Column(UUID(as_uuid=True), db.ForeignKey(User.id), nullable=False, @@ -1461,11 +1463,14 @@ class Confirm(JoinedTableMixin, ActionWithMultipleDevices): class Revoke(Confirm): - pass + """Users can revoke one confirmation of one action trade""" class ConfirmRevoke(Confirm): - pass + """Users can confirm and accept one action revoke""" + + def __repr__(self) -> str: + return '<{0.t} {0.id} accepted by {0.user}>'.format(self) class Trade(JoinedTableMixin, ActionWithMultipleDevices): @@ -1514,6 +1519,9 @@ class Trade(JoinedTableMixin, ActionWithMultipleDevices): cascade=CASCADE_OWN), primaryjoin='Trade.lot_id == Lot.id') + def __repr__(self) -> str: + return '<{0.t} {0.id} executed by {0.author}>'.format(self) + class InitTransfer(Trade): """The act of transfer ownership of devices between two agents"""