From aff86a8f941087903df278eabeb6010cb58ec856 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 29 Sep 2021 12:59:44 +0200 Subject: [PATCH] using ActionWithMultipleTradeDocuments intead of ActionWithMultipleDevices --- ereuse_devicehub/resources/action/models.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py index f0722803..23ddc0bf 100644 --- a/ereuse_devicehub/resources/action/models.py +++ b/ereuse_devicehub/resources/action/models.py @@ -1341,7 +1341,8 @@ class DataWipe(JoinedTableMixin, ActionWithMultipleDevices): primaryjoin='DataWipe.document_id == DataWipeDocument.id') -class ActionStatus(JoinedTableMixin, ActionWithMultipleDevices): +class ActionStatus(JoinedTableMixin, ActionWithMultipleTradeDocuments): +# class ActionStatus(JoinedTableMixin, ActionWithMultipleDevices): """This is a meta-action than mark the status of the devices""" rol_user_id = db.Column(UUID(as_uuid=True), @@ -1353,7 +1354,7 @@ class ActionStatus(JoinedTableMixin, ActionWithMultipleDevices): class Recycling(ActionStatus): - """This action mark one devices or container as recycling""" + """This action mark devices as recycling""" class Use(ActionStatus): @@ -1489,6 +1490,20 @@ class CancelReservation(Organize): """The act of cancelling a reservation.""" +class ActionStatusDocuments(JoinedTableMixin, ActionWithMultipleTradeDocuments): + """This is a meta-action than mark the status of the devices""" + rol_user_id = db.Column(UUID(as_uuid=True), + db.ForeignKey(User.id), + nullable=False, + default=lambda: g.user.id) + rol_user = db.relationship(User, primaryjoin=rol_user_id == User.id) + rol_user_comment = """The user that .""" + + +class RecyclingDocument(ActionStatusDocuments): + """This action mark one document or container as recycling""" + + class ConfirmDocument(JoinedTableMixin, ActionWithMultipleTradeDocuments): """Users confirm the one action trade this confirmation it's link to trade and the document that confirm