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

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

Open
wylie-medngine opened this issue Mar 24, 2024 · 1 comment

Comments

@wylie-medngine
Copy link

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.

@ThiefMaster
Copy link

ThiefMaster commented Mar 24, 2024

That sounds like you have a from wtforms.fields import datetime somewhere in your file.

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

No branches or pull requests

2 participants