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

Timestamp field #36

Closed
avaldevilap opened this issue Nov 3, 2020 · 2 comments
Closed

Timestamp field #36

avaldevilap opened this issue Nov 3, 2020 · 2 comments

Comments

@avaldevilap
Copy link

avaldevilap commented Nov 3, 2020

from datetime import datetime

from odmantic import Model
from pydantic import EmailStr


class Subscriber(Model):
    email: EmailStr
    subscribed_at: datetime = datetime.utcnow()

Trying to make a timestamp field, but I get the error: Value not declarable with JSON Schema

@dang-cb
Copy link

dang-cb commented Nov 3, 2020 via email

@avaldevilap
Copy link
Author

Sorry my bad, I actually defined it as a datetime 😅

@art049 art049 closed this as completed Nov 4, 2020
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