Python wtforms.fields 模块,HiddenField() 实例源码

我们从Python开源项目中,提取了以下27个代码示例,用于说明如何使用wtforms.fields.HiddenField()

项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:python_ddd_flask    作者:igorvinnicius    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:python_ddd_flask    作者:igorvinnicius    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:MTGLeague    作者:JackRamey    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
    return isinstance(field, HiddenField)
项目:jenkins-panel    作者:nikitinsm    | 项目源码 | 文件源码
def jenkins_form_factory(*args, **kwargs):
    attributes = dict\
        ( signature = fields.HiddenField\
            ()
        , view = fields.SelectField\
            ( u'???'
            , choices=JenkinsViewChoices()
            , default=None
            )
        , parent = InlineFieldList\
            ( InlineFormField
              ( ParentForm
              )
            , label=u'????????'
            , description=u'??????? ???????????? ?????'
            , validators=
              [ validators.DataRequired()
              , ]
            )
        , node = fields.SelectField\
            ( u'????'
            , choices=JenkinsNodeChoices()
            , validators=
              [ validators.DataRequired()
              , ]
            )
        , config = fields.StringField\
            ( u'???????? ??????'
            , widget=ReadonlyTextArea()
        )   )

    form_instance = type('Form', (form.Form, ), attributes)(*args, **kwargs)
    if form_instance.parent.data:
        attributes['param'] = InlineFormField\
            ( jenkins_param_form_factory(form_instance)
            , u'?????????'
            )

    kwargs['csrf_enabled'] = False
    return type('Form', (form.Form, ), attributes)(*args, **kwargs)
项目:maps4all-signup    作者:hack4impact    | 项目源码 | 文件源码
def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:Sudoku-Solver    作者:ayush1997    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:Konsole    作者:ColinHaley    | 项目源码 | 文件源码
def register_template_utils(app):
    """Register Jinja 2 helpers (called from __init__.py)."""

    @app.template_test()
    def equalto(value, other):
        return value == other

    @app.template_global()
    def is_hidden_field(field):
        from wtforms.fields import HiddenField
        return isinstance(field, HiddenField)

    app.add_template_global(index_for_role)
项目:micro-blog    作者:nickChenyx    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:python-flask-security    作者:weinbergdavid    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:railgun    作者:xin-xinhanggao    | 项目源码 | 文件源码
def _init_form_helper(self, form, lock_fields):
        """General :meth:`init_form` helper utility to remove all fields
        in `lock_fields`.

        :param form: The :class:`flask_wtf.Form` instance.
        :param lock_fields: :class:`list` of field names to be removed.
        """
        for k, v in form.__dict__.items():
            if isinstance(v, Field) and not isinstance(v, HiddenField):
                if k in lock_fields:
                    del form[k]
项目:Lixiang_zhaoxin    作者:hejaxian    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:Lixiang_zhaoxin    作者:hejaxian    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:Hawkeye    作者:tozhengxq    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def _is_hidden(field):
    """Detect if the field is hidden."""
    if isinstance(field, HiddenField):
        return True
    if isinstance(field.widget, HiddenInput):
        return True
    return False
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)
项目:search_within_videos    作者:iRapha    | 项目源码 | 文件源码
def init_app(app, extra_config_settings={}):
    # Read common settings from 'app/settings.py'
    app.config.from_object('app.settings')

    # Read environment-specific settings from 'app/local_settings.py'
    try:
        app.config.from_object('app.local_settings')
    except ImportError:
        print("The configuration file 'app/local_settings.py' does not exist.\n"+
              "Please copy app/local_settings_example.py to app/local_settings.py\n"+
              "and customize its settings before you continue.")
        exit()

    # Add/overwrite extra settings from parameter 'extra_config_settings'
    app.config.update(extra_config_settings)
    if app.testing:
        app.config['WTF_CSRF_ENABLED'] = False  # Disable CSRF checks while testing

    # Initialize Flask-SQLAlchemy and Flask-Script _after_ app.config has been read
    #db.init_app(app)

    # Setup Flask-Migrate
    #migrate = Migrate(app, db)
    #manager.add_command('db', MigrateCommand)

    # Setup Flask-Mail
    mail = Mail(app)

    # Setup WTForms CsrfProtect
    #CsrfProtect(app)

    # Define bootstrap_is_hidden_field for flask-bootstrap's bootstrap_wtf.html
    from wtforms.fields import HiddenField

    def is_hidden_field_filter(field):
        return isinstance(field, HiddenField)

    app.jinja_env.globals['bootstrap_is_hidden_field'] = is_hidden_field_filter

    # Setup an error-logger to send emails to app.config.ADMINS
    init_email_error_handler(app)

    # Setup Flask-User to handle user account related forms
    #from app.models import User, MyRegisterForm
    #from app.views import user_profile_page

    #db_adapter = SQLAlchemyAdapter(db, User)  # Setup the SQLAlchemy DB Adapter
    #user_manager = UserManager(db_adapter, app,  # Init Flask-User and bind to app
                               #register_form=MyRegisterForm,  # using a custom register form with UserProfile fields
                               #user_profile_view_function=user_profile_page,
    #)

    #import app.manage_commands