eceform

eceform

In [9]:
import flask_wtf
In [ ]:
flask_wtf.form.SecureForm
In [4]:
 
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-51d0e95ce512> in <module>()
----> 1 flask_wtf.form.Form('name')

/usr/local/lib/python3.4/dist-packages/wtforms/form.py in __call__(cls, *args, **kwargs)
    210                     bases.append(mro_class.Meta)
    211             cls._wtforms_meta = type('Meta', tuple(bases), {})
--> 212         return type.__call__(cls, *args, **kwargs)
    213 
    214     def __setattr__(cls, name, value):

/usr/local/lib/python3.4/dist-packages/flask_wtf/form.py in __init__(self, formdata, obj, prefix, csrf_context, secret_key, csrf_enabled, *args, **kwargs)
     66 
     67         if csrf_enabled is None:
---> 68             csrf_enabled = current_app.config.get('WTF_CSRF_ENABLED', True)
     69 
     70         self.csrf_enabled = csrf_enabled

/usr/local/lib/python3.4/dist-packages/werkzeug/local.py in __getattr__(self, name)
    336         if name == '__members__':
    337             return dir(self._get_current_object())
--> 338         return getattr(self._get_current_object(), name)
    339 
    340     def __setitem__(self, key, value):

/usr/local/lib/python3.4/dist-packages/werkzeug/local.py in _get_current_object(self)
    295         """
    296         if not hasattr(self.__local, '__release_local__'):
--> 297             return self.__local()
    298         try:
    299             return getattr(self.__local, self.__name__)

/usr/local/lib/python3.4/dist-packages/flask/globals.py in _find_app()
     32     top = _app_ctx_stack.top
     33     if top is None:
---> 34         raise RuntimeError('working outside of application context')
     35     return top.app
     36 

RuntimeError: working outside of application context
In [ ]:
 
In [8]:
import flask

class MyForm(FlaskForm):
    name = flask_wtf.Form('name', validators=[DataRequired()])
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-8-32cbaddf1b86> in <module>()
      1 import flask
      2 
----> 3 class MyForm(FlaskForm):
      4     name = flask_wtf.Form('hello')

NameError: name 'FlaskForm' is not defined
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 

Comments

Comments powered by Disqus