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
@dataclass
class GetByDate:
class Meta:
namespace = NAMESPACE
date: datetime = field(
default=None,
metadata={
"name": "Date",
"type": "Element"
}
)
But when I trying to proceed request with date in it I got a warning:
/xsdata/formats/converter.py:123: ConverterWarning: No converter registered for `<class 'datetime.datetime'>`
warnings.warn(f"No converter registered for `{data_type}`", ConverterWarning)
And maybe it would be nice to have datetime converter which will try to parse from most common datetimes formats such as
for datetimes:
%y-%m-%dT%H:%M:%S
%y-%m-%d %H:%M:%S
...and so on
for dates:
%y-%m-%d
%d-%m-%y
...and so on
And by default it can serialize datetimes to %y-%m-%dT%H:%M:%S or a local time format.
So a user can specify in a serializer config which format he wants to have
The text was updated successfully, but these errors were encountered:
I have avoided mapping the xs:date, xs:dateTime, xs:time to python datetime for some time now because of all the possible formats, but it's definitely in my todos.
For now there is a way to register a custom converter see here and the full script here
I was trying to create such dataclass
But when I trying to proceed request with date in it I got a warning:
And maybe it would be nice to have datetime converter which will try to parse from most common datetimes formats such as
for datetimes:
for dates:
And by default it can serialize datetimes to
%y-%m-%dT%H:%M:%S
or a local time format.So a user can specify in a serializer config which format he wants to have
The text was updated successfully, but these errors were encountered: