Python Marshmallow - Customize Formatting Of Class Member
I have Marshmallow serializer written as class TestSchema(Schema): created_date = fields.Str(required=False) class Test(database.Model): created_date = database.Colum
Solution 1:
Use fields.DateTime
marshmallow field for SQLAlchemy datetime object instead of fields.Str
. In fact, iso format is default format, but you can specify other in format
parameter. Docs: here
Post a Comment for "Python Marshmallow - Customize Formatting Of Class Member"