Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
使用 JSON 可序列化枚举自动生成棉花糖模式
创建与我的模型相同的棉花糖模式的日子已经一去不复返了 我发现这个优秀的答案 https stackoverflow com a 42892443 4097322这解释了我如何使用简单的装饰器从 SQA 模型自动生成模式 因此我实现了它并替换
python
enums
sqlalchemy
marshmallow
Flask、Marshmallow 3 和 webargs use_args 无法解析参数
对于 Flask 1 1 2 marshmallow 3 6 1 和 webargs 6 1 0 我的所有论点始终是missing Schema class ExportSearchSchema Schema limit fields In
python
Flask
marshmallow
webargs
使用 Marshmallow 序列化 SQLAlchemy
我正在遵循教程并使用下面的代码 我还使用 Postman 查看服务器的状态http localhost 5000 行星 http localhost 5000 planets 但我得到了500内部服务器错误 当我应该看到我创建的行星的 JS
python
python3x
Flask
flasksqlalchemy
marshmallow
为什么在将 Marshmallow 与 SQLAlchemy 自动映射一起使用时出现“Decimal 类型的对象不可 JSON 序列化”?
Using automap base from sqlalchemy ext automap映射我的桌子 不能够shema dumps result getting raise TypeError f Object of type o cl
python3x
flasksqlalchemy
marshmallow
Python(flask/marshmallow)ValueError:解包值太多(预期为 2)
我正在开发 Flask 项目 并使用 marshmallow 来验证用户输入 下面是一个代码片段 def create user in data request get json data errors Userschema load in
python
python3x
API
Flask
marshmallow
SqlAlchemy 非持久列
我正在尝试使用 sqlalchemy 定义一个模型 这样我只需要在内存中进行处理的列之一 我没有相应的数据库列 我需要它 以便当我保存内存对象时 它不应该尝试保留该特殊列 更多上下文 我正在使用 python marshmallow 库将
python
sqlalchemy
marshmallow
Flask sqlAlchemy 与 Flask_Marshmallow 的验证问题
使用flask marshmallow进行输入验证 并使用scheme load 我无法捕获模型中 validates装饰器生成的错误 我捕获了资源中的结果和错误 但错误会直接发送给用户 模型 py python from sqlalche
python
Exception
flasksqlalchemy
marshmallow
SqlAlchemy 与 Marshmallow 的关系
我正在尝试返回 JSON 甚至返回一对多 sqlalchemy 查询的完整字符串 我此时正在使用 Marshmallow 来尝试执行此操作 但它不断返回不完整的数据 我有两个模型定义为 class UserModel db Model ta
json
Flask
sqlalchemy
marshmallow
Marshmallow 序列化与父字段嵌套
抱歉 如果之前有人问过这个问题 我实际上找不到解决方案或类似的问题 可能使用了错误的词语 我正在更新现有的 Flask API 该 API 使用 marshmallow 和 peewee 从我们无法控制的客户端接收数据 无法更改 JSON
Flask
marshmallow
marshmallow - 序列化时如何将架构属性映射到另一个键?
我需要创建一个与给定规范一致的棉花糖模式 其中我无法更改键名称 其中一个关键是 Python 中的保留关键字 from class TemporalExtentSchema Schema from fields String require
python
marshmallow
通过 Marshmallow 使用 @post_dump 添加总行数?
我需要添加此查询中返回的行数 queryPostgres db text SELECT COUNT OVER as RowCount FROM SELECT 3958 75 acos sin lat1 57 2958 sin cast la
python3x
postgresql
sqlalchemy
flasksqlalchemy
marshmallow
在 Python 和 Marshmallow 中嵌套数据库中不存在的字段
我在棉花糖中有这些模式 class Parents Schema father fields String data key father mother fields String data key mother class UserSch
python
serialization
marshmallow
flaskmarshmallow
棉花糖循环导入
我有两个彼此相关的对象 我希望能够通过相关属性来访问一个对象 E g A b relationship obj some property 如何在不创建循环导入的情况下执行此操作 lib py class Relationship obje
python
pythonimport
ImportError
marshmallow
具有多态性的Python棉花糖树结构
我有以下树结构代码 class Node def init self node id str self node id node id self children def add child self node Node if isinst
python
serialization
polymorphism
marshmallow
SQLAlchemy @property 使用 dump_only 在 Marshmallow 中导致“未知字段”错误
我正在使用flask marshmallow marshmallow v3 0 0rc1 flask marshmallow 0 9 0 和flask sqlalchemy sqlalchemy 1 2 16 flask sqlalchem
python
Flask
sqlalchemy
flasksqlalchemy
marshmallow
Flask Marshmallow 使用额外字段序列化多对多关系
我在具有序列化模型对象的 Flask 应用程序中遇到问题 该对象与关联表中存储的额外字段具有多对多关系 我想要一个序列化数据 如下所示 id 123 name name mobile phone number interest 1 2 3
python
Flask
serialization
sqlalchemy
marshmallow
Python Marshmallow Field 可以是两种不同的类型
我想指定一个棉花糖模式 对于我的一个字段 我希望对其进行验证 但它可以是字符串或字符串列表 我尝试过原始字段类型 但这允许一切通过 有没有办法只验证我想要的两种类型 就像是 value fields Str or fields List 我
python
marshmallow