本文整理汇总了Python中flask_restful.fields.Boolean方法的典型用法代码示例。如果您正苦于以下问题:Python fields.Boolean方法的具体用法?Python fields.Boolean怎么用?Python fields.Boolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flask_restful.fields
的用法示例。
在下文中一共展示了fields.Boolean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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()
示例2: marshal
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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)
示例3: __init__
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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()
示例4: __init__
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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()
示例5: marshal
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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)
示例6: marshal
# 需要导入模块: from flask_restful import fields [as 别名]
# 或者: from flask_restful.fields import Boolean [as 别名]
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)