2018-06-26 13:35:13 +00:00
|
|
|
from ereuse_devicehub.resources.device.schemas import Cellphone, Component, Computer, \
|
|
|
|
ComputerMonitor, DataStorage, Desktop, Device, Display, GraphicCard, HardDrive, Laptop, Mobile, \
|
|
|
|
Monitor, Motherboard, NetworkAdapter, Processor, RamModule, Server, Smartphone, \
|
|
|
|
SolidStateDrive, Tablet, TelevisionSet
|
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):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Computer
|
|
|
|
|
|
|
|
|
|
|
|
class DesktopDef(ComputerDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Desktop
|
|
|
|
|
|
|
|
|
|
|
|
class LaptopDef(ComputerDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Laptop
|
|
|
|
|
|
|
|
|
|
|
|
class ServerDef(ComputerDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Server
|
|
|
|
|
|
|
|
|
2018-06-26 13:35:13 +00:00
|
|
|
class MonitorDef(DeviceDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-06-26 13:35:13 +00:00
|
|
|
SCHEMA = Monitor
|
2018-04-27 17:16:43 +00:00
|
|
|
|
|
|
|
|
2018-06-26 13:35:13 +00:00
|
|
|
class ComputerMonitorDef(MonitorDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-06-20 21:18:15 +00:00
|
|
|
SCHEMA = ComputerMonitor
|
|
|
|
|
|
|
|
|
2018-06-26 13:35:13 +00:00
|
|
|
class TelevisionSetDef(MonitorDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = TelevisionSet
|
|
|
|
|
|
|
|
|
|
|
|
class MobileDef(DeviceDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = Mobile
|
|
|
|
|
|
|
|
|
|
|
|
class SmartphoneDef(MobileDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = Smartphone
|
|
|
|
|
|
|
|
|
|
|
|
class TabletDef(MobileDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = Tablet
|
|
|
|
|
|
|
|
|
|
|
|
class CellphoneDef(MobileDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = Cellphone
|
|
|
|
|
|
|
|
|
2018-04-27 17:16:43 +00:00
|
|
|
class ComponentDef(DeviceDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Component
|
|
|
|
|
|
|
|
|
|
|
|
class GraphicCardDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = GraphicCard
|
|
|
|
|
|
|
|
|
2018-06-10 16:47:49 +00:00
|
|
|
class DataStorageDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-06-10 16:47:49 +00:00
|
|
|
SCHEMA = DataStorage
|
|
|
|
|
|
|
|
|
|
|
|
class HardDriveDef(DataStorageDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = HardDrive
|
|
|
|
|
|
|
|
|
2018-06-10 16:47:49 +00:00
|
|
|
class SolidStateDriveDef(DataStorageDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-06-10 16:47:49 +00:00
|
|
|
SCHEMA = SolidStateDrive
|
|
|
|
|
|
|
|
|
2018-04-27 17:16:43 +00:00
|
|
|
class MotherboardDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = Motherboard
|
|
|
|
|
|
|
|
|
|
|
|
class NetworkAdapterDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = NetworkAdapter
|
|
|
|
|
|
|
|
|
|
|
|
class RamModuleDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-04-27 17:16:43 +00:00
|
|
|
SCHEMA = RamModule
|
2018-05-11 16:58:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ProcessorDef(ComponentDef):
|
2018-06-24 14:57:49 +00:00
|
|
|
VIEW = None
|
2018-05-11 16:58:48 +00:00
|
|
|
SCHEMA = Processor
|
2018-06-26 13:35:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
class DisplayDef(ComponentDef):
|
|
|
|
VIEW = None
|
|
|
|
SCHEMA = Display
|