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

Use AwareDateTime when generating field from DateTime(timezone=True) #407

Open
lafrech opened this issue Aug 31, 2021 · 0 comments
Open

Comments

@lafrech
Copy link
Member

lafrech commented Aug 31, 2021

I didn't investigate this. I don't know if there would be an issue with this.

Basically, when I have a model with

creation_date = sqla.Column(sqla.DateTime(timezone=True), nullable=False)

I need to override the auto field in the schema

class ItemSchema(AutoSchema):
    class Meta:
        model = Item

    id = msa.auto_field(dump_only=True)
    creation_date = ma.fields.AwareDateTime(required=True)

I suppose this could be automatized.

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

1 participant