Skip to content
New issue

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

DateField is not supported #48

Open
yuanxu-li opened this issue Jun 7, 2017 · 2 comments
Open

DateField is not supported #48

yuanxu-li opened this issue Jun 7, 2017 · 2 comments

Comments

@yuanxu-li
Copy link

I understand we can still defined a DateField using serpy.MethodField(), but it would be handy to have one already.

@clarkduvall
Copy link
Owner

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.

@pawelad
Copy link

pawelad commented Aug 24, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants