Python flask.ext.wtf.Form() Examples

The following are 2 code examples of flask.ext.wtf.Form(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask.ext.wtf , or try the search function .
Example #1
Source File: __init__.py    From pylint-flask with GNU General Public License v2.0 6 votes vote down vote up
def transform_flask_from_long(node):
    '''Translates a flask.ext.wtf from-style import into a non-magical import.

    Translates:
        from flask.ext.wtf import Form
        from flask.ext.admin.model import InlineFormAdmin
    Into:
        from flask_wtf import Form
        from flask_admin.model import InlineFormAdmin

    '''
    actual_module_name = make_non_magical_flask_import(node.modname)
    new_node = nodes.ImportFrom(actual_module_name, node.names, node.level)
    copy_node_info(node, new_node)
    mark_transformed(new_node)
    return new_node 
Example #2
Source File: __init__.py    From pylint-flask with GNU General Public License v2.0 5 votes vote down vote up
def is_flask_from_import_long(node):
    '''Check if an import is like `from flask.ext.wtf import Form`.'''
    # Check for transformation first so we don't double process
    return not is_transformed(node) and node.modname.startswith('flask.ext.')