Skip to content

WTForms shouldn't be imported if not used #267

Closed
@thomasst

Description

@thomasst

While I understand that flask-mongoengine provides specific support for WTForms, it should only attempt to import WTForms if we actually use the flask_mongoengine.wtf module. That way projects that don't need WTForms won't have to include and import that library. Currently, .wtf is imported in __init__.py, and is used in MongoEngine.__init__ which calls _patch_base_field. This wasn't an issue prior to version 0.8 (0982432).

Can we do the patching somewhere else / only when importing the .wtf module explicitly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementEnhancement update for old feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions