Fixing HID field to accepts null values

This commit is contained in:
nad 2020-03-25 16:47:57 +01:00
parent 16560462fa
commit 713452e4e1
2 changed files with 3 additions and 3 deletions

View File

@ -51,13 +51,13 @@ class Device(Thing):
internally for software; users should not use this. internally for software; users should not use this.
""" """
type = Column(Unicode(STR_SM_SIZE), nullable=False) type = Column(Unicode(STR_SM_SIZE), nullable=False)
hid = Column(Unicode(), check_lower('hid'), unique=True) hid = Column(Unicode(), check_lower('hid'), unique=False)
hid.comment = """The Hardware ID (HID) is the unique ID traceability hid.comment = """The Hardware ID (HID) is the unique ID traceability
systems use to ID a device globally. This field is auto-generated systems use to ID a device globally. This field is auto-generated
from Devicehub using literal identifiers from the device, from Devicehub using literal identifiers from the device,
so it can re-generated *offline*. so it can re-generated *offline*.
""" + HID_CONVERSION_DOC """ + HID_CONVERSION_DOC
model = Column(Unicode, check_lower('model')) model = Column(Unicode(), check_lower('model'))
model.comment = """The model of the device in lower case. model.comment = """The model of the device in lower case.
The model is the unambiguous, as technical as possible, denomination The model is the unambiguous, as technical as possible, denomination

View File

@ -20,7 +20,7 @@ from ereuse_devicehub.resources.user import schemas as s_user
class Device(Thing): class Device(Thing):
__doc__ = m.Device.__doc__ __doc__ = m.Device.__doc__
id = Integer(description=m.Device.id.comment, dump_only=True) id = Integer(description=m.Device.id.comment, dump_only=True)
hid = SanitizedStr(lower=True, dump_only=True, description=m.Device.hid.comment) hid = SanitizedStr(lower=True, description=m.Device.hid.comment)
tags = NestedOn('Tag', tags = NestedOn('Tag',
many=True, many=True,
collection_class=OrderedSet, collection_class=OrderedSet,