Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismostert committed Mar 11, 2024
1 parent f673ae7 commit 6ac5fc8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/models/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ Example(good=11.0, bad=-9.9827632)

### Overriding standard type converters

It is also possible to override the converter for any of the standard types.
For example, we can override the standard serialize function for `XmlDateTime`.
It is also possible to override the converter for any of the standard types. For
example, we can override the standard serialize function for `XmlDateTime`.

```python
>>> from dataclasses import dataclass
Expand Down Expand Up @@ -303,8 +303,8 @@ For example, we can override the standard serialize function for `XmlDateTime`.
...
>>> print(serializer.render(datetime_obj))
<DateTimeObject>2023-11-24T10:38:56.123</DateTimeObject>
...
...
>>>
>>>
>>> class MyXmlDateTimeConverter(Converter):
... def deserialize(self, value: Any, **kwargs: Any) -> XmlDateTime:
... return XmlDateTime.from_string(value)
Expand All @@ -321,7 +321,7 @@ For example, we can override the standard serialize function for `XmlDateTime`.
>>> converter.register_converter(XmlDateTime, MyXmlDateTimeConverter())
>>> print(serializer.render(datetime_obj))
<DateTimeObject>24-11-2023T10:38:56</DateTimeObject>
...
>>>
>>> converter.unregister_converter(XmlDateTime)

```

0 comments on commit 6ac5fc8

Please sign in to comment.