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