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):