From 083ce4e66082d0608b7f4c7acfc9e1a865aca914 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 4 Mar 2021 19:24:05 +0100 Subject: [PATCH] show code in web --- ereuse_devicehub/resources/device/models.py | 1 + ereuse_devicehub/resources/device/schemas.py | 1 + 2 files changed, 2 insertions(+) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 255f57c5..8a0a0120 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -124,6 +124,7 @@ class Device(Thing): allocated = db.Column(Boolean, default=False) allocated.comment = "device is allocated or not." code = db.Column(db.CIText(), nullable=True, unique=True, default=create_code) + code.comment = "device have a unique code." _NON_PHYSICAL_PROPS = { 'id', diff --git a/ereuse_devicehub/resources/device/schemas.py b/ereuse_devicehub/resources/device/schemas.py index 706b7e03..4fc818ea 100644 --- a/ereuse_devicehub/resources/device/schemas.py +++ b/ereuse_devicehub/resources/device/schemas.py @@ -66,6 +66,7 @@ class Device(Thing): sku = SanitizedStr(description=m.Device.sku.comment) image = URL(description=m.Device.image.comment) allocated = Boolean(description=m.Device.allocated.comment) + code = SanitizedStr(description=m.Device.code.comment) @pre_load def from_actions_to_actions_one(self, data: dict):