forked from platypush/platypush
15 lines
340 B
Python
15 lines
340 B
Python
from marshmallow import pre_load
|
|
|
|
from platypush.schemas.dataclasses import DataClassSchema
|
|
|
|
|
|
class SystemBaseSchema(DataClassSchema):
|
|
"""
|
|
Base schema for system information.
|
|
"""
|
|
|
|
@pre_load
|
|
def pre_load(self, data, **_) -> dict:
|
|
if hasattr(data, '_asdict'):
|
|
data = data._asdict()
|
|
return data
|