ContinuumIO / flask-ldap-login

Flask ldap integration
BSD 2-Clause "Simplified" License
105 stars 35 forks source link

'module' object has no attribute 'TextField' #7

Open csabaszilveszter opened 10 years ago

csabaszilveszter commented 10 years ago
Traceback (most recent call last):
  File "runserver.py", line 5, in <module>
    from portalapp import app
  File "/Users/myuser/myapp/__init__.py", line 4, in <module>
    from flask_ldap_login import LDAPLoginManager
  File "/Users/myuser/myapp/lib/python2.7/site-packages/flask_ldap_login/__init__.py", line 216, in <module>
    class LDAPLoginForm(wtf.Form):
  File "/Users/myuser/myapp/lib/python2.7/site-packages/flask_ldap_login/__init__.py", line 224, in LDAPLoginForm
    username = wtf.TextField('Username', validators=[wtf.Required()])
AttributeError: 'module' object has no attribute 'TextField'
csabaszilveszter commented 10 years ago

sorry for being so short but I'm here if you need details

srossross commented 10 years ago

This could be because the flask-wtf module is out of date.

When I run:

$ pip freeze | grep Flask-WTF
Flask-WTF==0.8.2

I see that I am using running version 0.8.2. What are you running?

This should be a hard requirement in the setup.py file, but it is not. I will fix this once we find the root issue here.

csabaszilveszter commented 10 years ago

I've checked the version-history of flask-wtf and they say in the docs: The current version of Flask-WTF is 0.9.5 I'm confused now cause I'm running: Flask-WTF==0.10.0

should I downgrade?

tswicegood commented 10 years ago

0.10.2 is the latest release on PyPI -- the docs are just out of date.

Looking at the upgrade doc, it looks as though the field imports are no longer supported:

Dropping the imports of wtforms is a big change, it may be lots of pain for you, but the imports are hard to maintain. Instead of importing Fields from Flask-WTF, you need to import them from the original wtforms

Looks like the code needs to change to be future-proof.

srossross commented 10 years ago

@szilvesztercsab I've just released flask-ldap-login-0.3.0 with flask-wtf >= 0.8 fix included.

csabaszilveszter commented 10 years ago

damn, that was fast...

Very much appreciated and mega-thanks... ;)

Great to know there's an active community here and would love to help out too if I'd be smarter :P