Skip to content

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

@lafrech

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.

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