You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as_marshmallow_schema returned the following message for the ConstantField attribute:
@instance.register
class Dog(Document):
breed = fields.ConstantField("Mongrel")
DogMaSchema = Dog.schema.as_marshmallow_schema()
Traceback (most recent call last):
File "...\AppData\Local\Programs\Python\Python38\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 5, in <module>
File "...\.venv\lib\site-packages\umongo\abstract.py", line 66, in as_marshmallow_schema
nmspc = {
File "...\.venv\lib\site-packages\umongo\abstract.py", line 67, in <dictcomp>
name: field.as_marshmallow_field()
File "...\.venv\lib\site-packages\umongo\abstract.py", line 209, in as_marshmallow_field
m_field = m_class(**field_kwargs, metadata=self.metadata)
TypeError: __init__() missing 1 required positional argument: 'constant'
The text was updated successfully, but these errors were encountered:
GoriilaGrodd
changed the title
How do I create a JSON serialization of my umongo classes?
ConstantField produces error when converting to marshmallow schema
Jun 30, 2022
as_marshmallow_schema
returned the following message for theConstantField
attribute:The text was updated successfully, but these errors were encountered: