change required for display, functionality and apparence

This commit is contained in:
Cayo Puigdefabregas 2020-12-17 13:08:06 +01:00
parent 36cd61c0bd
commit b8812f0b82
3 changed files with 7 additions and 5 deletions

View File

@ -28,6 +28,9 @@ def get_inv():
def upgrade(): def upgrade():
op.alter_column('computer', 'chassis', nullable=True, schema=f'{get_inv()}') op.alter_column('computer', 'chassis', nullable=True, schema=f'{get_inv()}')
op.alter_column('display', 'size', nullable=True, schema=f'{get_inv()}')
op.alter_column('display', 'resolution_width', nullable=True, schema=f'{get_inv()}')
op.alter_column('display', 'resolution_height', nullable=True, schema=f'{get_inv()}')
# pass # pass

View File

@ -260,9 +260,8 @@ class TestBios(Test):
class VisualTest(Test): class VisualTest(Test):
__doc__ = m.VisualTest.__doc__ __doc__ = m.VisualTest.__doc__
appearance_range = EnumField(AppearanceRange, required=True, data_key='appearanceRange') appearance_range = EnumField(AppearanceRange, data_key='appearanceRange')
functionality_range = EnumField(FunctionalityRange, functionality_range = EnumField(FunctionalityRange,
required=True,
data_key='functionalityRange') data_key='functionalityRange')
labelling = Boolean() labelling = Boolean()

View File

@ -342,19 +342,19 @@ class Device(Thing):
class DisplayMixin: class DisplayMixin:
"""Base class for the Display Component and the Monitor Device.""" """Base class for the Display Component and the Monitor Device."""
size = Column(Float(decimal_return_scale=1), check_range('size', 2, 150), nullable=False) size = Column(Float(decimal_return_scale=1), check_range('size', 2, 150), nullable=True)
size.comment = """The size of the monitor in inches.""" size.comment = """The size of the monitor in inches."""
technology = Column(DBEnum(DisplayTech)) technology = Column(DBEnum(DisplayTech))
technology.comment = """The technology the monitor uses to display technology.comment = """The technology the monitor uses to display
the image. the image.
""" """
resolution_width = Column(SmallInteger, check_range('resolution_width', 10, 20000), resolution_width = Column(SmallInteger, check_range('resolution_width', 10, 20000),
nullable=False) nullable=True)
resolution_width.comment = """The maximum horizontal resolution the resolution_width.comment = """The maximum horizontal resolution the
monitor can natively support in pixels. monitor can natively support in pixels.
""" """
resolution_height = Column(SmallInteger, check_range('resolution_height', 10, 20000), resolution_height = Column(SmallInteger, check_range('resolution_height', 10, 20000),
nullable=False) nullable=True)
resolution_height.comment = """The maximum vertical resolution the resolution_height.comment = """The maximum vertical resolution the
monitor can natively support in pixels. monitor can natively support in pixels.
""" """