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
I would recommend creating a subclass of serpy.Field(), and overriding the to_value method. This will allow you to use it just like any other field, and reuse it in other serializers instead of having to define a MethodField in each one.
I think both DateField and DatetimeField really should be supported out of the box.
I ended up implementing my own that just call .isoformat() - if you think that's good enough solution then I'd be happy to make a pull request to add them the project.
I understand we can still defined a
DateField
usingserpy.MethodField()
, but it would be handy to have one already.The text was updated successfully, but these errors were encountered: