当前位置: 首页>>代码示例>>Python>>正文


Python fields.HiddenField方法代码示例

本文整理汇总了Python中wtforms.fields.HiddenField方法的典型用法代码示例。如果您正苦于以下问题:Python fields.HiddenField方法的具体用法?Python fields.HiddenField怎么用?Python fields.HiddenField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wtforms.fields的用法示例。


在下文中一共展示了fields.HiddenField方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: is_hidden_field_filter

# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import HiddenField [as 别名]
def is_hidden_field_filter(field):
        return isinstance(field, HiddenField) 
开发者ID:jpush,项目名称:jbox,代码行数:4,代码来源:__init__.py

示例2: _is_hidden

# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import HiddenField [as 别名]
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 
开发者ID:jpush,项目名称:jbox,代码行数:9,代码来源:form.py

示例3: get_form

# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import HiddenField [as 别名]
def get_form(klass):
        """Gets the appropriate form for a given investigation"""
        form = model_form(klass, exclude=klass.exclude_fields)

        # An empty name is the same as no name
        form.name = WTFStringField(
            'Name', filters=[lambda name: name or None])

        form.created_by = WTFHiddenField(
            'created_by', default=current_user.username)

        form.tags = TagListField("Tags")

        return form 
开发者ID:yeti-platform,项目名称:yeti,代码行数:16,代码来源:investigation.py

示例4: register_template_utils

# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import HiddenField [as 别名]
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) 
开发者ID:gita,项目名称:BhagavadGita,代码行数:15,代码来源:utils.py

示例5: create_app

# 需要导入模块: from wtforms import fields [as 别名]
# 或者: from wtforms.fields import HiddenField [as 别名]
def create_app(extra_config_settings={}):
    """Create a Flask application.
    """
    # Instantiate Flask
    app = Flask(__name__)

    # Load common settings
    app.config.from_object('app.settings')
    # Load environment specific settings
    app.config.from_object('app.local_settings')
    # Load extra settings from extra_config_settings param
    app.config.update(extra_config_settings)

    # Setup Flask-SQLAlchemy
    db.init_app(app)

    # Setup Flask-Migrate
    migrate.init_app(app, db)

    # Setup Flask-Mail
    mail.init_app(app)

    # Setup WTForms CSRFProtect
    csrf_protect.init_app(app)

    # Register blueprints
    from .views import register_blueprints
    register_blueprints(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 .models.user_models import User
    from .views.main_views import user_profile_page

    # Setup Flask-User
    user_manager = UserManager(app, db, User)

    @app.context_processor
    def context_processor():
        return dict(user_manager=user_manager)

    return app 
开发者ID:lingthio,项目名称:Flask-User-starter-app,代码行数:54,代码来源:__init__.py


注:本文中的wtforms.fields.HiddenField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。