wtforms :: meta :: DefaultMeta :: Class DefaultMeta
[hide private]
[frames] | no frames]

Class DefaultMeta


This is the default Meta class which defines all the default values and therefore also the 'API' of the class Meta interface.

Instance Methods [hide private]
 
bind_field(self, form, unbound_field, options)
bind_field allows potential customization of how fields are bound.
 
build_csrf(self, form)
Build a CSRF implementation.
 
get_translations(self, form)
Override in subclasses to provide alternate translations factory.
 
render_field(self, field, render_kw)
render_field allows customization of how widget rendering is done.
 
update_values(self, values)
Given a dictionary of values, update values on this `Meta` instance.
 
wrap_formdata(self, form, formdata)
wrap_formdata allows doing custom wrappers of WTForms formdata.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  cache_translations = True
  csrf = False
  csrf_class = None
hash(x)
  csrf_context = None
hash(x)
  csrf_field_name = 'csrf_token'
  csrf_secret = None
hash(x)
  locales = False
  translations_cache = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

bind_field(self, form, unbound_field, options)

 

bind_field allows potential customization of how fields are bound.

The default implementation simply passes the options to
:meth:`UnboundField.bind`.

:param form: The form.
:param unbound_field: The unbound field.
:param options:
    A dictionary of options which are typically passed to the field.

:return: A bound field

build_csrf(self, form)

 

Build a CSRF implementation. This is called once per form instance.

The default implementation builds the class referenced to by :attr:`csrf_class` with zero arguments. If `csrf_class` is ``None``, will instead use the default implementation :class:`wtforms.csrf.session.SessionCSRF`.

:param form: The form. :return: A CSRF implementation.

get_translations(self, form)

 

Override in subclasses to provide alternate translations factory. See the i18n documentation for more.

:param form: The form. :return: An object that provides gettext() and ngettext() methods.

render_field(self, field, render_kw)

 

render_field allows customization of how widget rendering is done.

The default implementation calls ``field.widget(field, **render_kw)``

wrap_formdata(self, form, formdata)

 

wrap_formdata allows doing custom wrappers of WTForms formdata.

The default implementation detects webob-style multidicts and wraps them, otherwise passes formdata back un-changed.

:param form: The form. :param formdata: Form data. :return: A form-input wrapper compatible with WTForms.