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
info
If you try to use the following
class WithCustomEncoders(BaseModel): dt: datetime @serializer('dt') def serialize_dt(self, dt: datetime): return dt.timestamp()
You get an error about SerializationInfo doesn't have a timestamp() method.
SerializationInfo
timestamp()
If you change the signature to def serialize_dt(self, dt: datetime, info):, it works fine.
def serialize_dt(self, dt: datetime, info):
The text was updated successfully, but these errors were encountered:
Allow serializers to ignore the info argument
cd5dfc5
Closes #5269
Resolved
Sorry, something went wrong.
adriangb
No branches or pull requests
If you try to use the following
You get an error about
SerializationInfo
doesn't have atimestamp()
method.If you change the signature to
def serialize_dt(self, dt: datetime, info):
, it works fine.The text was updated successfully, but these errors were encountered: