#206 Development instance build issues
Closed: Fixed 2 years ago by pingou. Opened 2 years ago by austinpowered.

I started looking at fedocal #203 some calendars don't work with Google Calendars URL import

After building the venv I got the following when trying to run the app. "Cannot import name 'TextField' from 'wtforms'"

The above error occurs when the TextField property is used with WTForms version 3.0 or above because the wtforms.TextField is deprecated in favor of wtforms.StringField.

Two solutions are offered by this post.

Solution 1 - Replace TextField type with StringField
Note: This solution works with WTForms 3.x and 2.x versions

from wtforms import StringField
// replace all TextField usages with StringField type

Solution 2 - Use the latest stable 2.x version of WTForms

// Use 2.x version - edit requirements.txt to set version
wtforms==2.3.3

After making the change to requirements.txt, I was able to move past the error and on to other issues with my local dev instance. Next, I will create a PR with this change.

I'm not ready to ask for help on my local dev instance. Perhaps another ticket will be needed. ;)


On Thu, Dec 09, 2021 at 05:05:01PM +0000, T.C. Williams wrote:

Solution 1 - Replace TextField type with StringField
Note: This solution works with WTForms 3.x and 2.x versions

from wtforms import StringField
// replace all TextField usages with StringField type

This seems to be the one giving the most flexibility :)

A cursory glance at /TextField/StringField/g doesn't seem to create any issues. I'll submit a new PR.

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #208 Merged 2 years ago