Skip to content

Commit

Permalink
ImportError: cannot import name 'TextField' from 'wtforms' realpython#63
Browse files Browse the repository at this point in the history
  • Loading branch information
skbhati199 committed Nov 3, 2023
1 parent 488e336 commit e7255bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions _updated/app/forms.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, EqualTo, Length


class RegisterForm(Form):
name = TextField(
name = StringField(
'Username', validators=[DataRequired(), Length(min=6, max=25)]
)
email = TextField(
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
password = PasswordField(
Expand All @@ -21,11 +21,11 @@ class RegisterForm(Form):


class LoginForm(Form):
name = TextField('Username', [DataRequired()])
name = StringField('Username', [DataRequired()])
password = PasswordField('Password', [DataRequired()])


class ForgotForm(Form):
email = TextField(
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
10 changes: 5 additions & 5 deletions forms.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, EqualTo, Length

# Set your classes here.


class RegisterForm(Form):
name = TextField(
name = StringField(
'Username', validators=[DataRequired(), Length(min=6, max=25)]
)
email = TextField(
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)
password = PasswordField(
Expand All @@ -23,11 +23,11 @@ class RegisterForm(Form):


class LoginForm(Form):
name = TextField('Username', [DataRequired()])
name = StringField('Username', [DataRequired()])
password = PasswordField('Password', [DataRequired()])


class ForgotForm(Form):
email = TextField(
email = StringField(
'Email', validators=[DataRequired(), Length(min=6, max=40)]
)

0 comments on commit e7255bb

Please sign in to comment.