show code in web

This commit is contained in:
Cayo Puigdefabregas 2021-03-04 19:24:05 +01:00
parent bf5cae5f96
commit 083ce4e660
2 changed files with 2 additions and 0 deletions

View File

@ -124,6 +124,7 @@ class Device(Thing):
allocated = db.Column(Boolean, default=False) allocated = db.Column(Boolean, default=False)
allocated.comment = "device is allocated or not." allocated.comment = "device is allocated or not."
code = db.Column(db.CIText(), nullable=True, unique=True, default=create_code) code = db.Column(db.CIText(), nullable=True, unique=True, default=create_code)
code.comment = "device have a unique code."
_NON_PHYSICAL_PROPS = { _NON_PHYSICAL_PROPS = {
'id', 'id',

View File

@ -66,6 +66,7 @@ class Device(Thing):
sku = SanitizedStr(description=m.Device.sku.comment) sku = SanitizedStr(description=m.Device.sku.comment)
image = URL(description=m.Device.image.comment) image = URL(description=m.Device.image.comment)
allocated = Boolean(description=m.Device.allocated.comment) allocated = Boolean(description=m.Device.allocated.comment)
code = SanitizedStr(description=m.Device.code.comment)
@pre_load @pre_load
def from_actions_to_actions_one(self, data: dict): def from_actions_to_actions_one(self, data: dict):