Python flask_restful.fields.Boolean() Examples

The following are 6 code examples of flask_restful.fields.Boolean(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask_restful.fields , or try the search function .
Example #1
Source File: gateway.py    From floranet with MIT License 6 votes vote down vote up
def __init__(self, **kwargs):
        self.restapi = kwargs['restapi']
        self.server = kwargs['server']
        self.fields = {
            'host': fields.String,
            'eui': fields.Integer,
            'name': fields.String,
            'enabled': fields.Boolean,
            'power': fields.Integer,
            'created': fields.DateTime(dt_format='iso8601'),
            'updated': fields.DateTime(dt_format='iso8601')
        }
        self.parser = reqparse.RequestParser(bundle_errors=True)
        self.parser.add_argument('host', type=str)
        self.parser.add_argument('eui', type=int)
        self.parser.add_argument('name', type=str)
        self.parser.add_argument('enabled', type=inputs.boolean)
        self.parser.add_argument('power', type=int)
        self.args = self.parser.parse_args() 
Example #2
Source File: azure_iot_mqtt.py    From floranet with MIT License 6 votes vote down vote up
def marshal(self):
        """Get REST API marshalled fields as an orderedDict
        
        Returns:
            OrderedDict of fields defined by marshal_fields
        """
        marshal_fields = {
            'type': fields.String(attribute='__class__.__name__'),
            'id': fields.Integer(attribute='appinterface.id'),
            'name': fields.String,
            'iothost': fields.String,
            'keyname': fields.String,
            'keyvalue': fields.String,
            'started': fields.Boolean,
        }
        return marshal(self, marshal_fields) 
Example #3
Source File: system.py    From floranet with MIT License 5 votes vote down vote up
def __init__(self, **kwargs):
        self.restapi = kwargs['restapi']
        self.server = kwargs['server']
        self.fields = {
            'name': fields.String,
            'listen': fields.String,
            'port': fields.Integer,
            'webport': fields.Integer,
            'apitoken': fields.String,
            'freqband': fields.String,
            'netid': fields.Integer,
            'duplicateperiod': fields.Integer,
            'fcrelaxed': fields.Boolean,
            'otaastart': fields.Integer,
            'otaaend':  fields.Integer,
            'macqueueing': fields.Boolean,
            'macqueuelimit': fields.Integer,
            'adrenable': fields.Boolean,
            'adrmargin': fields.Float,
            'adrcycletime': fields.Integer,
            'adrmessagetime': fields.Integer,
        }
        self.parser = reqparse.RequestParser(bundle_errors=True)
        self.parser.add_argument('name', type=str)
        self.parser.add_argument('listen', type=str)
        self.parser.add_argument('port', type=int)
        self.parser.add_argument('webport', type=int)
        self.parser.add_argument('apitoken', type=str)
        self.parser.add_argument('freqband', type=str)
        self.parser.add_argument('netid', type=int)
        self.parser.add_argument('duplicateperiod', type=int)
        self.parser.add_argument('fcrelaxed', type=bool)
        self.parser.add_argument('otaastart', type=int)
        self.parser.add_argument('otaaend', type=int)
        self.parser.add_argument('macqueuing', type=bool)
        self.parser.add_argument('macqueuelimit', type=int)
        self.parser.add_argument('adrenable', type=bool)
        self.parser.add_argument('adrmargin', type=float)
        self.parser.add_argument('adrcycletime', type=int)
        self.parser.add_argument('adrmessagetime', type=int)
        self.args = self.parser.parse_args() 
Example #4
Source File: device.py    From floranet with MIT License 5 votes vote down vote up
def __init__(self, **kwargs):
        self.restapi = kwargs['restapi']
        self.server = kwargs['server']
        self.fields = {
            'deveui': fields.Integer,
            'name': fields.String,
            'devclass': fields.String,
            'enabled': fields.Boolean,
            'otaa': fields.Boolean,
            'devaddr': fields.Integer,
            'appeui': fields.Integer,
            'appskey': fields.Integer,
            'nwkskey': fields.Integer,
            'tx_datr': fields.String,
            'snr_average': fields.Float,
            'appname': fields.String,
            'latitude': fields.Float,
            'longitude': fields.Float,
            'created': fields.DateTime(dt_format='iso8601'),
            'updated': fields.DateTime(dt_format='iso8601')
        }
        self.parser = reqparse.RequestParser(bundle_errors=True)
        self.parser.add_argument('deveui', type=int)
        self.parser.add_argument('name', type=str)
        self.parser.add_argument('devclass', type=str)
        self.parser.add_argument('enabled', type=inputs.boolean)
        self.parser.add_argument('otaa', type=inputs.boolean)
        self.parser.add_argument('devaddr', type=int)
        self.parser.add_argument('appeui', type=int)
        self.parser.add_argument('nwkskey', type=int)
        self.parser.add_argument('appskey', type=int)
        self.parser.add_argument('appname', type=str)
        self.parser.add_argument('latitude', type=float)
        self.parser.add_argument('longitude', type=float)
        self.args = self.parser.parse_args() 
Example #5
Source File: reflector.py    From floranet with MIT License 5 votes vote down vote up
def marshal(self):
        """Get REST API marshalled fields as an orderedDict
        
        Returns:
            OrderedDict of fields defined by marshal_fields
        """
        marshal_fields = {
            'type': fields.String(attribute='__class__.__name__'),
            'id': fields.Integer(attribute='appinterface.id'),
            'name': fields.String,
            'started': fields.Boolean
        }
        return marshal(self, marshal_fields) 
Example #6
Source File: file_text_store.py    From floranet with MIT License 5 votes vote down vote up
def marshal(self):
        """Get REST API marshalled fields as an orderedDict
        
        Returns:
            OrderedDict of fields defined by marshal_fields
        """
        marshal_fields = {
            'type': fields.String(attribute='__class__.__name__'),
            'id': fields.Integer(attribute='appinterface.id'),
            'name': fields.String,
            'file': fields.String,
            'started': fields.Boolean
        }
        return marshal(self, marshal_fields)