當前位置: 首頁>>代碼示例>>Python>>正文


Python fields.List方法代碼示例

本文整理匯總了Python中flask_restplus.fields.List方法的典型用法代碼示例。如果您正苦於以下問題:Python fields.List方法的具體用法?Python fields.List怎麽用?Python fields.List使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在flask_restplus.fields的用法示例。


在下文中一共展示了fields.List方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: target_tags

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def target_tags(self) -> typing.List[SensorTag]:
        """
        The target tags for this model

        Returns
        -------
        typing.List[SensorTag]
        """
        if "target_tag_list" in g.metadata["dataset"]:
            return normalize_sensor_tags(
                g.metadata["dataset"]["target_tag_list"],
                asset=g.metadata["dataset"].get("asset"),
                default_asset=g.metadata["dataset"].get("default_asset"),
            )
        else:
            return [] 
開發者ID:equinor,項目名稱:gordo,代碼行數:18,代碼來源:base.py

示例2: get

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def get(self):
        """
        List our endpoints.
        """
        endpoints = sorted(rule.rule for rule in api.app.url_map.iter_rules())
        return {"Available endpoints": endpoints} 
開發者ID:gcallah,項目名稱:indras_net,代碼行數:8,代碼來源:api_endpoints.py

示例3: tags

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def tags(self) -> typing.List[SensorTag]:
        """
        The input tags for this model

        Returns
        -------
        typing.List[SensorTag]
        """
        return normalize_sensor_tags(
            g.metadata["dataset"]["tag_list"],
            asset=g.metadata["dataset"].get("asset"),
            default_asset=g.metadata["dataset"].get("default_asset"),
        ) 
開發者ID:equinor,項目名稱:gordo,代碼行數:15,代碼來源:base.py

示例4: get

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def get(self):
        '''List all resources'''        
        return DAO.services 
開發者ID:salrashid123,項目名稱:envoy_discovery,代碼行數:5,代碼來源:main.py

示例5: get

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def get(self):
        """List all products"""
        page = request.args.get("page", 1, int)
        products = Product.query.paginate(page, per_page=8).items
        return products 
開發者ID:hjlarry,項目名稱:flask-shop,代碼行數:7,代碼來源:product.py

示例6: init

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def init(api, cors, impl):
    """Configures REST handlers for state resource."""
    namespace = webutils.namespace(
        api, __name__, 'Trace REST operations'
    )

    model = {
        'name': fields.String(description='Application name'),
        'instances': fields.List(
            fields.String(description='Instance IDs')
        ),
    }
    trace_model = api.model(
        'Trace', model
    )

    @namespace.route('/<app_name>')
    @api.doc(params={'app_name': 'Application name'})
    class _TraceAppResource(restplus.Resource):
        """Treadmill application trace information resource.
        """

        @webutils.get_api(api, cors,
                          marshal=api.marshal_with,
                          resp_model=trace_model)
        def get(self, app_name):
            """Return trace information of a Treadmill application.
            """
            trace_info = impl.get(app_name)
            if trace_info is None:
                raise exc.NotFoundError(
                    'No trace information available for {}'.format(app_name)
                )
            return trace_info 
開發者ID:Morgan-Stanley,項目名稱:treadmill,代碼行數:36,代碼來源:trace.py

示例7: init

# 需要導入模塊: from flask_restplus import fields [as 別名]
# 或者: from flask_restplus.fields import List [as 別名]
def init(api, cors, impl):
    """Configures REST handlers for DNS resource."""

    namespace = webutils.namespace(
        api, __name__, 'DNS REST operations'
    )

    server_model = fields.String(description='Server')

    model = {
        '_id': fields.String(
            description='Name',
            max_length=32),
        'location': fields.String(description='Location'),
        'nameservers': fields.List(server_model),
        'rest-server': fields.List(server_model),
        'zkurl': fields.String(description='Zookeeper URL'),
        'fqdn': fields.String(description='FQDN'),
        'ttl': fields.String(description='Time To Live'),
    }

    dns_model = api.model(
        'DNS', model
    )

    @namespace.route('/')
    class _DNSList(restplus.Resource):
        """Treadmill DNS resource"""

        @webutils.get_api(api, cors,
                          marshal=api.marshal_list_with,
                          resp_model=dns_model)
        def get(self):
            """Returns list of configured DNS servers."""
            return impl.list()

    @namespace.route('/<dns>')
    @api.doc(params={'dns': 'DNS ID/name or FQDN'})
    class _DNSResource(restplus.Resource):
        """Treadmill DNS resource."""

        @webutils.get_api(api, cors,
                          marshal=api.marshal_with,
                          resp_model=dns_model)
        def get(self, dns):
            """Return Treadmill cell configuration."""
            return impl.get(dns) 
開發者ID:Morgan-Stanley,項目名稱:treadmill,代碼行數:49,代碼來源:dns.py


注:本文中的flask_restplus.fields.List方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。