小编Pra*_*ddy的帖子

如何使用flask-ReSTplus记录帖子正文?

插入用户数据

如何记录预期在value字段中发布的输入正文以显示以便用户知道要发布的内容?目前使用的数据如下:

{
 "customer_id": "",
 "service_id": "",
 "customer_name": "",
 "site_name": "",
 "service_type": ""
}
Run Code Online (Sandbox Code Playgroud)

我们可以用上面的 json 默认填充值吗?

代码:

post_parser = reqparse.RequestParser()
post_parser.add_argument('database',  type=list, help='user data', location='json')

@ns_database.route('/insert_user')
class database(Resource):
@ns_database.expect(post_parser)
def post(self):
    """insert data"""
    json_data = request.json
    customer_id = json_data['customer_id']
    service_id = json_data['service_id']
    customer_name = json_data['customer_name']
    site_name = json_data['site_name']
    service_type = json_data['service_type']
Run Code Online (Sandbox Code Playgroud)

python flask flask-restplus

9
推荐指数
1
解决办法
9610
查看次数

如何使用ansible清理apt缓存?

链接暗示存在一个模块,但我无法实现它。任何解决方案都是预期的。

apt ansible ansible-playbook

3
推荐指数
1
解决办法
4644
查看次数

标签 统计

ansible ×1

ansible-playbook ×1

apt ×1

flask ×1

flask-restplus ×1

python ×1