Skip to content

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

Description

@lafrech

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions