當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。