Skip to content

Flask, Sqlalchemy app crashes with namespace collision on native Python datetime module. #840

@wylie-medngine

Description

@wylie-medngine
from flask_wtf import FlaskForm
from wtforms import (
    BooleanField,
    EmailField,
    IntegerField,
    StringField,
    HiddenField,
    DecimalField,
    # validators,
)
# from wtforms.fields import EmailField

from datetime import datetime, date, time, timedelta
#[...]

AttributeError: module 'wtforms.fields.datetime' has no attribute 'now'

I was able to fix it by moving the datetime import into the instance/class method bodies. Weird, but seems to hold.

I haven't time to make a minimal reproducable error; I hope this issue report is some help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions