2018-06-10 16:47:49 +00:00
|
|
|
from ereuse_devicehub.resources.device.schemas import Component, Computer, DataStorage, Desktop, \
|
|
|
|
Device, GraphicCard, HardDrive, Laptop, Microtower, Motherboard, Netbook, NetworkAdapter, \
|
|
|
|
Processor, RamModule, Server, SolidStateDrive
|
2018-04-10 15:06:39 +00:00
|
|
|
from ereuse_devicehub.resources.device.views import DeviceView
|
2018-04-27 17:16:43 +00:00
|
|
|
from teal.resource import Converters, Resource
|
2018-04-10 15:06:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
class DeviceDef(Resource):
|
|
|
|
SCHEMA = Device
|
|
|
|
VIEW = DeviceView
|
|
|
|
ID_CONVERTER = Converters.int
|
2018-04-27 17:16:43 +00:00
|
|
|
AUTH = True
|
|
|
|
|
|
|
|
|
|
|
|
class ComputerDef(DeviceDef):
|
|
|
|
SCHEMA = Computer
|
|
|
|
|
|
|
|
|
|
|
|
class DesktopDef(ComputerDef):
|
|
|
|
SCHEMA = Desktop
|
|
|
|
|
|
|
|
|
|
|
|
class LaptopDef(ComputerDef):
|
|
|
|
SCHEMA = Laptop
|
|
|
|
|
|
|
|
|
|
|
|
class NetbookDef(ComputerDef):
|
|
|
|
SCHEMA = Netbook
|
|
|
|
|
|
|
|
|
|
|
|
class ServerDef(ComputerDef):
|
|
|
|
SCHEMA = Server
|
|
|
|
|
|
|
|
|
|
|
|
class MicrotowerDef(ComputerDef):
|
|
|
|
SCHEMA = Microtower
|
|
|
|
|
|
|
|
|
|
|
|
class ComponentDef(DeviceDef):
|
|
|
|
SCHEMA = Component
|
|
|
|
|
|
|
|
|
|
|
|
class GraphicCardDef(ComponentDef):
|
|
|
|
SCHEMA = GraphicCard
|
|
|
|
|
|
|
|
|
2018-06-10 16:47:49 +00:00
|
|
|
class DataStorageDef(ComponentDef):
|
|
|
|
SCHEMA = DataStorage
|
|
|
|
|
|
|
|
|
|
|
|
class HardDriveDef(DataStorageDef):
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = HardDrive
|
|
|
|
|
|
|
|
|
2018-06-10 16:47:49 +00:00
|
|
|
class SolidStateDriveDef(DataStorageDef):
|
|
|
|
SCHEMA = SolidStateDrive
|
|
|
|
|
|
|
|
|
2018-04-27 17:16:43 +00:00
|
|
|
class MotherboardDef(ComponentDef):
|
|
|
|
SCHEMA = Motherboard
|
|
|
|
|
|
|
|
|
|
|
|
class NetworkAdapterDef(ComponentDef):
|
|
|
|
SCHEMA = NetworkAdapter
|
|
|
|
|
|
|
|
|
|
|
|
class RamModuleDef(ComponentDef):
|
|
|
|
SCHEMA = RamModule
|
2018-05-11 16:58:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProcessorDef(ComponentDef):
|
|
|
|
SCHEMA = Processor
|