Adds deposit field in Computer
This commit is contained in:
parent
14d5379edb
commit
bdd996a132
|
@ -376,9 +376,10 @@ class Computer(Device):
|
|||
id = Column(BigInteger, ForeignKey(Device.id), primary_key=True)
|
||||
chassis = Column(DBEnum(ComputerChassis), nullable=False)
|
||||
chassis.comment = """The physical form of the computer.
|
||||
|
||||
|
||||
It is a subset of the Linux definition of DMI / DMI decode.
|
||||
"""
|
||||
deposit = Column(Integer, check_range('deposit',min=0,max=100), default=0)
|
||||
|
||||
def __init__(self, chassis, **kwargs) -> None:
|
||||
chassis = ComputerChassis(chassis)
|
||||
|
|
|
@ -141,6 +141,7 @@ class DisplayMixin:
|
|||
class Computer(DisplayMixin, Device):
|
||||
components = ... # type: Column
|
||||
chassis = ... # type: Column
|
||||
deposit = ... # type: Column
|
||||
|
||||
def __init__(self, **kwargs) -> None:
|
||||
super().__init__(**kwargs)
|
||||
|
|
|
@ -121,7 +121,9 @@ class Computer(Device):
|
|||
dump_only=True,
|
||||
collection_class=set,
|
||||
description=m.Computer.privacy.__doc__)
|
||||
|
||||
deposit = Integer(dump_only=True,
|
||||
data_key='deposit',
|
||||
description=m.Computer.deposit.__doc__)
|
||||
|
||||
class Desktop(Computer):
|
||||
__doc__ = m.Desktop.__doc__
|
||||
|
|
Reference in New Issue