We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a schema with a Time field. When it serializes a value with microseconds, e.g. 2016-05-27T11:02:35.267899, it results in 2016-05-27T1.
Time
2016-05-27T11:02:35.267899
2016-05-27T1
The reason are those lines:
if value.microsecond: return ret[:12]
https://github.com/marshmallow-code/marshmallow/blob/dev/marshmallow/fields.py#L911
I have no idea what your idea was behind that, @sloria . ret[:19] would do it in my case, don't know if there might be other cases.
ret[:19]
The text was updated successfully, but these errors were encountered:
Certainly looks like a bug. I'd gladly review and merge a PR fixing this.
Sorry, something went wrong.
Fix _serialize() of Time field
9949a21
When a Time object has microsecond value, the _serialize() method returns the following string format: 'HH:mm:ss.SSSSSS' marshmallow-code#464
608501e
dbfaba2
When a Time object has microsecond value, the _serialize() method returns the following string format: 'HH:mm:ss.SSSSSS' #464
No branches or pull requests
I have a schema with a
Time
field. When it serializes a value with microseconds, e.g.2016-05-27T11:02:35.267899
, it results in2016-05-27T1
.The reason are those lines:
https://github.com/marshmallow-code/marshmallow/blob/dev/marshmallow/fields.py#L911
I have no idea what your idea was behind that, @sloria .
ret[:19]
would do it in my case, don't know if there might be other cases.The text was updated successfully, but these errors were encountered: