Example #1
0
class ClockSchema(ma.ModelSchema):
    class Meta:
        model = ClockDevice
        fields = ('id', 'scale', 'time', 'url')

    scale = ma.Integer(attribute='_scale')
    url = ma.AbsoluteUrlFor('clock_detail', id='<id>')
Example #2
0
class ControllerBlockSchema(ma.ModelSchema):
    class Meta:
        model = ControllerBlock
        fields = ('type', 'updated_at', 'is_static', 'object_id', 'name',
                  'url')

    type = ma.Function(lambda obj: obj.__class__.__name__)
    url = ma.AbsoluteUrlFor('controllerblockdetail', id='<id>')
Example #3
0
class TemperatureSensorDeviceSchema(ma.ModelSchema):
    """
    Serialization schema for the TemperatureSensorDevice
    """
    class Meta:
        model = TemperatureSensorDevice
        fields = ('id', 'value', 'url')

    url = ma.AbsoluteUrlFor('temperature_sensor_detail', id='<id>')
Example #4
0
class PIDLoopSchema(ma.ModelSchema):
    """
    Serialization schema for the PID Loop algorithm
    """
    class Meta:
        model = PID
        fields = ('id', 'input', 'actuator', 'setpoint', 'url')

    url = ma.AbsoluteUrlFor('pid_loop_detail', id='<id>')
Example #5
0
class ControllerSchema(ma.ModelSchema):
    class Meta:
        model = Controller
        fields = ('id', 'connected', 'profile', 'available_blocks', 'name',
                  'description', 'uri')

    profile = ma.HyperlinkRelated('controllerprofiledetail')
    available_blocks = ma.AbsoluteUrlFor('controlleravailableblocklist',
                                         controller_id='<id>')
Example #6
0
class ClockSchema(ControllerBlockSchema):
    """
    A clock that ticks
    """
    class Meta:
        model = ClockDevice
        fields = ('id', 'scale', 'time', 'url')

    scale = ma.Integer(attribute='_scale')
    url = ma.AbsoluteUrlFor('clockdevice.details_view', id='<id>')
Example #7
0
class PluginSchema(ma.Schema):
    id = ma.String(attribute="identifier")
    url = ma.AbsoluteUrlFor('plugin_detail', id='<identifier>')
    name = ma.String()
    description = ma.String()
    author = ma.String()
    license = ma.String()
    version = ma.String()
    website = ma.String()
    enabled = ma.Boolean()