Fork me on GitHub

Reference: Blueprints

This page contains documentation for available blueprints registered in the factory. This list is auto-generated and contains documentation of the following packages:

  • yafowil (core package)

  • yafowil.widget.ace

  • yafowil.widget.array

  • yafowil.widget.autocomplete

  • yafowil.widget.chosen

  • yafowil.widget.cron

  • yafowil.widget.datetime

  • yafowil.widget.dict

  • yafowil.widget.dynatree

  • yafowil.widget.image

  • yafowil.widget.location

  • yafowil.widget.multiselect

  • yafowil.widget.recaptcha

  • yafowil.widget.richtext

  • yafowil.widget.select2

  • yafowil.widget.slider

  • yafowil.widget.wysihtml5

ace

Add-on blueprint yafowil.widget.ace .

Properties

name

default

description

mode

'python'

ACE Mode.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

theme

'github'

ACE Theme.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

array

Add-on widget yafowil.widget.array.

Properties

name

default

description

add

True

Render add action.

Used by:
  • function

class

'array'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

'error'

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

remove

True

Render remove action.

Used by:
  • function

required

False

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

sort

True

Render move up and move down actions.

Used by:
  • function

static

False

Array is immutable. No Array actions are rendered. If True, add, remove and sort properties are ignored.

Used by:
  • function

table_class

None

CSS classes rendered on array table.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  2. function

  3. function

  1. function

  2. function

-/-

  1. function

autocomplete

Add-on blueprint yafowil.widget.autocomplete utilizing jquery.ui.autocomplete to offer the user a selection based on the input given so far.

Properties

name

default

description

class

'autocomplete'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

delay

'300'

Delay in milliseconds.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

minLength

'1'

Minimum input length to trigger autocomplete.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

source

required/ not set

Autocomplete source as python iterable or string defining JSON view callback.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  1. function

  2. function

-/-

-/-

-/-

checkbox

Single checkbox blueprint.

Properties

name

default

description

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

checked

None

Set ‘checked’ attribute explicit. If not given, compute by value.

Used by:
  • function

class

'checkbox'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

disabled

False

Flag whether checkbox is disabled.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

format

'bool'

Data-type of the extracted value. One out of bool or string.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

size

None global

Allowed input size.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

vocabulary

{True: 'Yes', False: 'No', <UNSET>: 'Unset'}

In display mode and if `bool` is set to `True` this mapping will be used for display of the value. Expected keys are `True`, `False` and `UNSET`.

Used by:
  • function

with_label

False

Render empty label tag after visible checkbox in order to make checkbox UI customizable via CSS like so:

input.large_checkbox {
    display: none;
}
input.large_checkbox + label {
    width: 59px;
    height: 60px;
    background: url('/checkbox_large.png');
}
input.large_checkbox:checked + label {
    background: url('/checkbox_large_selected.png');
}

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

chosen

Add-on blueprint yafowil.widget.chosen .

Properties

name

default

description

allow_single_deselect

None

Allow deselection of single elements.

Used by:
  • function

class

'chosen'

Common CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

disable_search

None

Disable search at all.

Used by:
  • function

disable_search_threshold

None

Disable the threshold, when the search popup opens.

Used by:
  • function

disabled

None global

Disables input.

Used by:
  • function

max_selected_options

None

Maximum number of selected options.

Used by:
  • function

multivalued

False

Used by:
  • function

new_values

None

Allow adding new values. For: yafowil js integration. Values: [True|False|None (default)].

Used by:
  • function

no_results_text

None

Text for no results.

Used by:
  • function

placeholder_text

None

Placeholder text.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

search_contains

None

Search also for substrings. Allowed values [True|False|None]. When using None or just not setting this value, the default of the Javascript widget is used.

Used by:
  • function

single_backstroke_delete

None

A single backstroke deletes the selected option.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

compound

A blueprint to create a compound of widgets. This blueprint creates a node. A node can contain sub-widgets.

Properties

name

default

description

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  1. function

-/-

-/-

cron

Add-on blueprint yafowil.widget.cron .

Properties

name

default

description

class

'crontab widget'

CSS classes for cron widget wrapper DOM element.

emptyvalue

required/ not set

If cron rule value empty, return as extracted value.

Used by:
  • function

lang

None

End year. Defaults to current year + 9

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  2. function

  1. function

-/-

-/-

datetime

Add-on blueprint yafowil.widget.datetime .

Properties

name

default

description

class

'datetime'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

dateinput_class

'dateinput'

CSS class rendered on date input field.

datepicker

False

Flag whether date picker is enabled.

Used by:
  • function

datepicker_class

'datepicker'

Flag whether date picker is enabled.

Used by:
  • function

delimiter

'.'

Delimiter used to render date in input field.

delimiter may be a callable taking widget and data as parameters expect to return a delimiter string.

Used by:
  • function

disabled

False

Disables input.

Used by:
  • function

empty_display_value

None

Value to display if no datetime value set. Used if widget mode is display.

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

format

'%Y.%m.%d %H:%M'

Pattern accepted by datetime.strftime or callable taking widget and data as parameters returning unicode or utf-8 string. Used if widget mode is display.

Used by:
  • function

locale

'iso'

Date input format locale. yafowil.widget.datetime uses bda.intellidatetime for input parsing. Take a look at this package for available locales.

locale may be a callable taking widget and data as parameters expect to return a locale string.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

time

False

Flag whether time input should be rendered.

time may be a callable taking widget and data as parameters expect to return a boolean.

Used by:
  • function

timeinput_class

'timeinput'

CSS class rendered on time input field.

timepicker

False

Flag whether time picker is enabled.

Used by:
  • function

timepicker_class

'timepicker'

jquery.ui timepicker binds to this class.

Used by:
  • function

tzinfo

None

Python datetime tzinfo object.

tzinfo may be a callable taking widget and data as parameters expect to return a tzinfo instance.

Used by:
  • function

unset_display_value

required/ not set

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  1. function

  1. function

-/-

-/-

dict

Add-on widget yafowil.widget.dict.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

'error'

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

head

{}

B/C Labels for dict keys and values columns. Expect a dict containing key and value keys.

Used by:
  • function

key_class

'keyfield'

CSS classes rendered on key input fields.

Used by:
  • function

key_label

<UNSET>

Label for dict keys column.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

static

False

Flag whether dict is immutable.

Used by:
  • function

table_class

'dictwidget'

CSS classes rendered on dict table.

Used by:
  • function

value_class

'valuefield'

CSS classes rendered on value input fields.

Used by:
  • function

value_label

<UNSET>

Label for dict values column.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  1. function

  2. function

  1. function

-/-

-/-

div

Blueprint rendering a ‘<div>’ element.

This is a hybrid blueprint. Check leaf property for details.

Properties

name

default

description

class

None

CSS classes for div tag.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

None

Dict containing data attributes for div tag.

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

id

None

Id attribute for div tag.

Used by:
  • function

leaf

None global

Leaf property can be used in conjunction with hybrid_extractor and hybrid_renderer using blueprints in order to mark compound widgets as leaf.

If set True, it causes bypassing auto delegation of extraction and rendering to compound_renderer respective compound_extractor if widget contains children.

This is useful if mixing blueprints which renders and handles compounds on it’s own with blueprints using hybrid rendering and extraction in order to prevent side effects due to multiple child rendering and extraction.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

email

Email (HTML5) input blueprint.

Properties

name

default

description

allowed_datatypes

[<class 'bytes'>, <class 'str'>]

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

class

'email'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  5. function

  1. function

  1. function

  2. function

-/-

-/-

error

Renders a tag with an error-message and the prior rendered output.

Properties

name

default

description

class

'error'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

message_class

'errormessage'

CSS class to apply to inner message-tag.

Used by:
  • function

message_tag

'div'

HTML tag to use to enclose each error message.

Used by:
  • function

position

'inner-before'

Error can be rendered at 3 different positions: before/ after the prior rendered output or with inner-before/ inner-after it puts the prior rendered output inside the tag used for the error message (beofre or after the message.

Used by:
  • function

render_empty

False

Render tag even if there is no error message.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

tag

'div'

HTML tag to use to enclose all error messages.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

field

Renders a div with an class field around the prior rendered output. This is supposed to be used for styling and grouping purposes.

Properties

name

default

description

class

'field'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

witherror

None

Put the class given with this property on the div if an error happened.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

fieldset

Renders a fieldset around the prior rendered output.

Properties

name

default

description

class

None

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

legend

False

Content of legend tag if legend should be rendered.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

file

A basic file upload blueprint.

Properties

name

default

description

accept

None

Accepted mimetype.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  2. function

  1. function

-/-

-/-

form

A html-form element as a compound of widgets.

Properties

name

default

description

action

required/ not set

Target web address (URL) to send the form to.

Used by:
  • function

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

enctype

'multipart/form-data'

Encryption type of the form. Only relevant for method post. Expect one out of application/x-www-form-urlencoded or multipart/form-data.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

method

'post'

One out of get or post.

Used by:
  • function

novalidate

True

Flag whether HTML5 form validation should be suppressed.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

help

Renders a tag with an help-message and the prior rendered output.

Properties

name

default

description

class

'help'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

help

''

Help text.

Used by:
  • function

position

'before'

Help can be rendered at 3 different positions: before/ after the prior rendered output or with inner-before/ inner-after it puts the prior rendered output inside the tag used for the help message (beofre or after the message.

Used by:
  • function

render_empty

False

Render tag even if there is no help message.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

tag

'div'

HTML tag to use to enclose all help messages.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

hidden

Hidden input blueprint.

Properties

name

default

description

allowed_datatypes

<UNSET> global

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

class

'hidden'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

type

'hidden'

Type of input tag.

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  1. function

  1. function

-/-

-/-

image

Add-on widget yafowil.widget.image.

Properties

name

default

description

accept

'image/*'

Accepted mimetype of image.

Used by:
  • function

alt

''

Image alternative text.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

'image'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

crop

None

Crop extracted file to size at offset. The created cropped image gets placed in the return value returned by file extractor under key cropped. Crop definition is a dict containing:

size

(width, height), mandatory

offset

(left, top), defaults to (0, 0)

fitting

Boolean, ignores offset if True, scales image to smaller site of size and centers larger one.

Used by:
  • function

error_class

'error'

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

maxdpi

None

Maximum DPI of image defined as 2-tuple containing (x, y).

Used by:
  • function

maxsize

None

Maximum size of image defined as 2-tuple containing (width, height) in pixel as integer.

Used by:
  • function

mindpi

None

Minimum DPI of image defined as 2-tuple containing (x, y).

Used by:
  • function

minsize

None

Minimum size of image defined as 2-tuple containing (width, height) in pixel as integer.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

required

False

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

scales

None

Scales to create on extraction. Scales are defined as dict, where the key represents the scale name and the value is a 2-tuple containing (width, height) in pixel. The created scales get placed in the return value returned by file extractor under key scales.

Used by:
  • function

src

None

Image URL if image present and displaying is desired.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  5. function

  6. function

  7. function

  8. function

  1. function

  2. function

  3. function

  1. function

-/-

-/-

label

Label blueprint.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

for

None

Optional dottedpath of widget to be labled

Used by:
  • function

label

required/ not set

Text to be displayed as a label.

Used by:
  • function

position

'before'

Label can be rendered at 3 different positions: before or after the prior rendered output or with inner it puts the prior rendered output inside the label tag.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

lines

Lines blueprint. Renders a textarea and extracts lines as list.

Properties

name

default

description

allowed_datatypes

<UNSET> global

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

'lines'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

cols

40

Number of characters.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

disabled

None global

Disables input.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

readonly

None

Flag textarea is readonly.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

rows

8

Number of lines.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

wrap

None

Either soft, hard, virtual, physical or off.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  5. function

  1. function

  1. function

  2. function

-/-

-/-

location

Add-on blueprint yafowil.widget.location

Properties

name

default

description

class

'location'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

'error'

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

lat

47.2667

Initial map center point latitude (north/south).

Used by:
  • function

lon

11.3833

Initial map center point longitude (east/west).

Used by:
  • function

min_zoom

2

Maximum map zoom level.

required

False

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

zoom

12

Initial map zoom level.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

multiselect

Add-on blueprint yafowil.widget.multiselect .

Properties

name

default

description

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

block_class

required/ not set

Used by:
  • function

class

'multiselect'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

disabled

None global

Disables input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

format

'block'

Used by:
  • function

label_checkbox_class

required/ not set

Used by:
  • function

label_radio_class

required/ not set

Used by:
  • function

listing_label_position

required/ not set

Used by:
  • function

listing_tag

required/ not set

Used by:
  • function

multivalued

True

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

size

None

Allowed input size.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

vocabulary

required/ not set

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

number

Number blueprint (HTML5).

Properties

name

default

description

allowed_datatypes

[<class 'int'>, <class 'float'>, 'int', 'integer', 'float']

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

class

'number'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

datatype

<class 'float'>

Callable for converting extracted value to output datatype. Allowed datatypes are int and float

datatype can also be defined as string with value out of ‘int’`, 'integer' or 'float'.

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

<UNSET>

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

max

None

Maximum value.

Used by:
  • function

min

None

Minimum value.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

step

None

Stepping value must be in.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  5. function

  1. function

  1. function

  2. function

-/-

-/-

password

Password blueprint.

The password is never rendered to markup, instead yafowil.common.PASSWORD_NOCHANGE_VALUE is set as value property on dom element. See yafowil.common.password_extractor for details on password extraction.

Properties

name

default

description

ascii

False

Flag ascii check should performed.

Used by:
  • function

autocomplete

None global

Switch autocomplete explizit to on or off.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

'password'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

disabled

None global

Disables input.

Used by:
  • function

displayplaceholder

'********'

Placeholder shown in display mode if password was set.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

minlength

-1

Minimum length of password.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

size

None global

Maximum length of password.

Used by:
  • function

strength

-1

Integer value <= 4. Define how many rules must apply to consider a password valid.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

weak_password_message

'Password too weak' global

Message shown if password is not strong enough.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  5. function

  6. function

  1. function

  1. function

-/-

-/-

proxy

Bypass arguments out of form namespace using a hidden field.

Properties

name

default

description

allowed_datatypes

<UNSET> global

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

class

None

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  1. function

  1. function

-/-

-/-

richtext

Add-on blueprint yafowil.widget.richtext .

Properties

name

default

description

cols

80

Number of characters.

mimetypes

['text/html']

List of mimetypes.

mimetypes_class

''

CSS class to be set on mimetypes selection.

mimetypes_data

{}

Dict containing data attributes to render on mimetypes selection.

readonly

None

Flag for readonly.

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

rows

25

Number of lines.

wrap

None

Either soft, hard, virtual, physical or off.

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

select

Selection Blueprint. Single selection as dropdown or radio-buttons. Multiple selection as selection-list or as checkboxes.

Properties

name

default

description

allowed_datatypes

<UNSET> global

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

block_class

None

CSS class to render on selection if block format.

Used by:
  • function

checkbox_label_class

None

CSS class to render on checkbox labels.

checkbox_wrapper_class

None

CSS class to render on checkbox wrapper.

class

'select'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

disabled

None global

Disables the whole widget or single selections. To disable the whole widget set the value to ‘True’. To disable single selection pass a iterable of keys to disable, i.e. ['foo', 'baz']. Defaults to False.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

format

'block'

Every value except ‘block’ results in either a list of radio buttons or checkboxes depending on the ‘multivalued’ property.

Used by:
  • function

label_checkbox_class

None

CSS class to render on checkbox labels.

This property is deprecated and will be remove as of yafowil 2.2. Use checkbox_label_class instead.

Used by:
  • function

label_radio_class

None

CSS class to render on radio button labels.

This property is deprecated and will be remove as of yafowil 2.2. Use radio_label_class instead.

Used by:
  • function

listing_label_position

'inner-after'

Label position if format is ‘single’. Behaves the same way as label widget position property.

Used by:
  • function

listing_tag

'div'

Desired rendering tag for selection if selection format is ‘single’. Valid values are ‘div’ and ‘ul’.

Used by:
  • function

multivalued

None

Flag whether multiple items can be selected.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

radio_label_class

None

CSS class to render on radio button labels.

radio_wrapper_class

None

CSS class to render on radio button wrapper.

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

size

None

Size of input if multivalued and format ‘block’.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

vocabulary

required/ not set

Vocabulary to be used for the selection list. Expects a dict-like or an iterable or a callable which returns one of both first. An iterable can consist out of strings or out of tuples with (key, value). The items in the result list are in the same order like the vocabulary.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  1. function

  1. function

  2. function

-/-

-/-

select2

Properties

name

default

description

adaptContainerCssClass

None

Function that filters/renames css classes as they are copied from the source tag to the select2 container tag:

adaptContainerCssClass(clazz)

The default implementation applies all classes without modification.

Used by:
  • function

adaptDropdownCssClass

None

Function that filters/renames css classes as they are copied from the source tag to the select2 dropdown tag:

adaptDropdownCssClass(clazz)

The default implementation always returns null thereby filtering out all classes.

Used by:
  • function

ajax

None

Options for the built in ajax query function. This object acts as a shortcut for having to manually write a function that performs ajax requests. The built-in function supports more advanced features such as throttling and dropping out-of-order responses.

In order for this function to work Select2 should be attached to a input type=’hidden’ tag instead of a select.

Used by:
  • function

ajaxurl

None

Ajax URL to JSON view returning an array of objects like:

[{id: 'id', text: 'text'}]
Used by:
  • function

allowClear

None

Whether or not a clear button is displayed when the select box has a selection. The button, when clicked, resets the value of the select box back to the placeholder, thus this option is only available when the placeholder is specified.

This option only works when the placeholder is specified.

When attached to a select an option with an empty value must be provided. This is the option that will be selected when the button is pressed since a select box requires at least one selection option.

Also, note that this option only works with non-multi-value based selects because multi-value selects always provide such a button for every selected option.

Used by:
  • function

closeOnSelect

None

If set to false the dropdown is not closed after a selection is made, allowing for rapid selection of multiple items. By default this option is set to true.

Only applies when configured in multi-select mode.

Used by:
  • function

containerCss

None

Inline css that will be added to select2’s container. Either an object containing css property/value key pairs or a function that returns such an object.

Used by:
  • function

containerCssClass

None

Css class that will be added to select2’s container tag.

Used by:
  • function

createSearchChoice

None

Creates a new selectable choice from user’s search term. Allows creation of choices not available via the query function. Useful when the user can create choices on the fly, eg for the ‘tagging’ usecase:

createSearchChoice(term)

If the function returns undefined or null no choice will be created. If a new choice is created it is displayed first in the selection list so that user may select it by simply pressing enter.

When used in combination with input[type=hidden] tag care must be taken to sanitize the id attribute of the choice object, especially stripping , as it is used as a value separator.

Used by:
  • function

createSearchChoicePosition

None

Define the position where to insert element created by createSearchChoice. The following values are supported:

top

Insert in the top of the list

bottom

Insert at the end of the list

function

A custom function. For example if you want to insert the new item in the second position:

$("#tags").select2({
    ...
    createSearchChoice: function(term) { ... },
    createSearchChoicePosition: function(list, item) {
        list.splice(1, 0, item);
    }
});
Used by:
  • function

data

None

Options for the built in query function that works with arrays.

If this element contains an array, each element in the array must contain id and text keys.

Alternatively, this element can be specified as an object in which results key must contain the data as an array and a text key can either be the name of the key in data items that contains text or a function that retrieves the text given a data element from the array.

Used by:
  • function

dropdownAutoWidth

None

When set to true attempts to automatically size the width of the dropdown based on content inside.

Used by:
  • function

dropdownCss

None

Inline css that will be added to select2’s dropdown container. Either an object containing css property/value key pairs or a function that returns such an object.

Used by:
  • function

dropdownCssClass

None

Css class that will be added to select2’s dropdown container.

Used by:
  • function

escapeMarkup

None

String escapeMarkup(String markup)

Function used to post-process markup returned from formatter functions. By default this function escapes html entities to prevent javascript injection.

Used by:
  • function

formatInputTooLong

None

String containing “Search input too long” message, or Function used to render the message:

formatInputTooLong(term, maxLength)
Used by:
  • function

formatInputTooShort

None

String containing “Search input too short” message, or Function used to render the message:

formatInputTooShort(term, minLength)
Used by:
  • function

formatLoadMore

None

String containing “Loading more results” message, or Function used to render the message:

formatLoadMore(pageNumber)
Used by:
  • function

formatNoMatches

None

String containing “No matches” message, or Function used to render the message:

formatNoMatches(term)
Used by:
  • function

formatResult

None

Function used to render a result that the user can select:

formatResult(object, container, query)

The default implementation expects the object to have a text property that is returned.

The implementation may choose to append elements directly to the provided container object, or return a single value and have it automatically appended.

When attached to a select the original <option> (or <optgroup>) element is accessible inside the specified function through the property item.element:

format(item) {
    var originalOption = item.element;
    return item.text
}
Used by:
  • function

formatResultCssClass

None

Function used to add css classes to result elements:

formatResultCssClass(object)

By default when attached to a select css classes from options will be automatically copied.

Used by:
  • function

formatSearching

None

String containing “Searching…” message, or Function used to render the message that is displayed while search is in progress:

formatSearching()
Used by:
  • function

formatSelection

None

Function used to render the current selection:

formatSelection(object, container)

The default implementation expects the object to have a text property that is returned.

The implementation may choose to append elements directly to the provided container object, or return a single value and have it automatically appended.

When attached to a select the original <option> (or <optgroup>) element is accessible inside the specified function through the property item.element:

format(item) {
    var originalOption = item.element;
    return item.text
}
Used by:
  • function

formatSelectionTooBig

None

String containing “You cannot select any more choices” message, or Function used to render the message:

formatSelectionTooBig(maxSize)
Used by:
  • function

id

None

Function used to get the id from the choice object or a string representing the key under which the id is stored:

id(object)

The default implementation expects the object to have a id property that is returned.

Used by:
  • function

initSelection

None

Called when Select2 is created to allow the user to initialize the selection based on the value of the element select2 is attached to.

Essentially this is an id->object mapping function:

initSelection(element, callback)

This function will only be called when there is initial input to be processed.

Used by:
  • function

inputtag

False

Render widget as input element instead of selection.

Used by:
  • function

loadMorePadding

None

Defines how many pixels need to be below the fold before the next page is loaded. The default value is 0 which means the result list needs to be scrolled all the way to the bottom for the next page of results to be loaded. This option can be used to trigger the load sooner, possibly resulting in a smoother user experience.

Used by:
  • function

matcher

None

Used to determine whether or not the search term matches an option when a built-in query function is used. The built in query function is used when Select2 is attached to a select, or the local or tags helpers are used:

matcher(term, text, option)

The default implementation is case insensitive and matches anywhere in the term:

function(term, text) {
    return text.toUpperCase().indexOf(term.toUpperCase()) >= 0;
}
Used by:
  • function

maximumInputLength

None

Maximum number of characters that can be entered for an input.

Used by:
  • function

maximumSelectionSize

None

The maximum number of items that can be selected in a multi-select control. If this number is less than 1 selection is not limited.

Once the number of selected items reaches the maximum specified the contents of the dropdown will be populated by the formatSelectionTooBig function.

Used by:
  • function

minimumInputLength

None

Number of characters necessary to start a search.

Used by:
  • function

minimumResultsForSearch

None

The minimum number of results that must be initially (after opening the dropdown for the first time) populated in order to keep the search field. This is useful for cases where local data is used with just a few results, in which case the search box is not very useful and wastes screen space.

The option can be set to a negative value to permanently hide the search field.

Only applies to single-value select boxes.

Used by:
  • function

multiple

None

Whether or not Select2 allows selection of multiple values.

When Select2 is attached to a select element this value will be ignored and select’s multiple attribute will be used instead.

Used by:
  • function

nextSearchTerm

None

Function used to determine what the next search term should be.

Function can be used when the dropdown is configured in single and multi-select mode. It is triggered after selecting an item. In single mode it is also triggered after initSelection (when provided).

Used by:
  • function

openOnEnter

None

If set to true the dropdown is opened when the user presses the enter key and Select2 is closed. By default this option is enabled.

Used by:
  • function

placeholder

None

Initial value that is selected if no other selection is made.

The placeholder can also be specified as a data-placeholder attribute on the select or input element that Select2 is attached to.

Note that because browsers assume the first option element is selected in non-multi-value select boxes an empty first option element must be provided (<option></option>) for the placeholder to work.

Used by:
  • function

placeholderOption

None

When attached to a select resolves the option that should be used as the placeholder. Can either be a function which given the select element should return the option element or a string first to indicate that the first option should be used.

This option is useful when Select2’s default of using the first option only if it has no value and no text is not suitable.

Used by:
  • function

query

None

Function used to query results for the search term:

query(options)

In order for this function to work Select2 should be attached to a input type=’hidden’ tag instead of a select.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

selectOnBlur

None

Set to true if you want Select2 to select the currently highlighted option when it is blurred.

Used by:
  • function

separator

None

Separator character or string used to delimit ids in value attribute of the multi-valued selects. The default delimiter is the , character.

Used by:
  • function

sortResults

None

Used to sort the results list for searching right before display. Useful for sorting matches by relevance to the user’s search term:

sortResults(results, container, query)

Defaults to no sorting:

function(results, container, query) {
    return results;
}
Used by:
  • function

tags

None

Puts Select2 into ‘tagging’ mode where the user can add new choices and pre-existing tags are provided via this options attribute which is either an array or a function that returns an array of objects or strings. If strings are used instead of objects they will be converted into an object that has an id and text attribute equal to the value of the string.

Used by:
  • function

tokenSeparators

None

An array of strings that define token separators for the default tokenizer function. By default, this option is set to an empty array which means tokenization using the default tokenizer is disabled. Usually it is sensible to set this option to a value similar to [‘,’, ‘ ‘].

Used by:
  • function

tokenizer

None

A tokenizer function can process the input typed into the search field after every keystroke and extract and select choices. This is useful, for example, in tagging scenarios where the user can create tags quickly by separating them with a comma or a space instead of pressing enter.

Tokenizer only applies to multi-selects:

tokenizer(input, selection, selectCallback, opts)
Used by:
  • function

width

None

Controls the width style attribute of the Select2 container div. The following values are supported:

off

No width attribute will be set. Keep in mind that the container div copies classes from the source element so setting the width attribute may not always be necessary.

element

Uses javascript to calculate the width of the source element.

copy

Copies the value of the width style attribute set on the source element.

resolve

First attempts to copy than falls back on element.

other values

if the width attribute contains a function it will be evaluated, otherwise the value is used verbatim.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-

slider

Add-on blueprint yafowil.widget.slider .

Properties

name

default

description

change

None

Optional Javascript change callback as string.

Used by:
  • function

data

{}

Additional data redered as HTML data attributes on slider wrapper DOM Element.

Used by:
  • function

height

None

Height of slider if orientation is vertical in pixel.

Used by:
  • function

max

None

Maximum slider value value. Defaults to 100.

Used by:
  • function

min

None

Minimum slider value. Defaults to 0.

Used by:
  • function

orientation

None

Slider Orientation. Either horizontal or vertical.

Used by:
  • function

range

None

Slider Range. Either True, 'min' or 'max'.

Used by:
  • function

show_value

False

Show value in addition to slider.

Used by:
  • function

slide

None

Optional Javascript slide callback as string.

Used by:
  • function

step

None

Snap slider to increments.

Used by:
  • function

unit

''

Slider value unit.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  1. function

-/-

-/-

submit

Submit action inside the form

Properties

name

default

description

action

True

Marks this widget as an action. One out of True or False.

Used by:
  • function

class

None global

Common CSS-class to put on.

Used by:
  • function

expression

True

Flag or expression callable whether this action is available to the user or not.

Used by:
  • function

handler

required/ not set

Handler is a callable which get called if this action performs. It expects two parameters: widget, data.

Used by:
  • function

label

required/ not set

Label of the submit.

Used by:
  • function

next

required/ not set

Next is a callable expected to return the web address. It expects a request as the only parameter.

Used by:
  • function

skip

False

Skips action and only perform next. One out of True or False.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

table

<table> compound widget for table creation.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

id

required/ not set

Value of table id attribute.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

tag

Render HTML tags with text. Useful for rendering headings etc.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

tag

required/ not set

HTML tag name.

Used by:
  • function

text

required/ not set

Tag contents.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

tbody

<tbody> compound widget for table creation.

Properties

name

default

description

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

td

<td> compound widget for table creation.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

colspan

required/ not set

Value of colspan attribute.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

id

required/ not set

Value of id attribute.

Used by:
  • function

leaf

None global

Leaf property can be used in conjunction with hybrid_extractor and hybrid_renderer using blueprints in order to mark compound widgets as leaf.

If set True, it causes bypassing auto delegation of extraction and rendering to compound_renderer respective compound_extractor if widget contains children.

This is useful if mixing blueprints which renders and handles compounds on it’s own with blueprints using hybrid rendering and extraction in order to prevent side effects due to multiple child rendering and extraction.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

rowspan

required/ not set

Value of rowspan attribute.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  1. function

-/-

-/-

text

One line text input blueprint.

Properties

name

default

description

allowed_datatypes

<UNSET> global

List of allowed datatypes. If UNSET, datatype converters are not restricted.

Used by:
  • function

autocomplete

None global

Switch autocomplete explizit to on or off.

Used by:
  • function

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

'text'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

datatype

None global

Callable for converting extracted value to output datatype.

datatype can also be defined as string with value out of 'str', 'unicode', 'int', 'integer', 'long', 'float' or 'uuid'.

ATTENTION: In python 3, string identifiers should not be used at all, but if,
the following must be known:
  • 'str' refers to bytes type.

  • 'unicode' refers to str type.

  • 'long' refers to int type.

Custom converter callables must raise one out of the following exceptions if conversion fails:

  • ValueError

  • UnicodeDecodeError

  • UnicodeEncodeError

Used by:
  • function

datatype_message

None global

Custom extraction error message if datatype conversion fails.

Used by:
  • function

disabled

False

Flag input field is disabled.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

size

None global

Allowed input size.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

type

'text'

Type of input tag.

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  1. function

  1. function

  2. function

-/-

-/-

textarea

HTML textarea blueprint.

Properties

name

default

description

autofocus

None global

Whether this field gets the focus automatically or not (if browser supports it).

Used by:
  • function

class

'textarea'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

cols

80

Number of characters.

Used by:
  • function

data

{} global

Additional data rendered as HTML5 data attributes on DOM Element.

Used by:
  • function

disabled

None global

Disables input.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

placeholder

None global

Whether this input has a placeholder value or not (if browser supports it).

Used by:
  • function

readonly

None

Flag textarea is readonly.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

rows

25

Number of lines.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

title

None global

Optional help text to be rendered in the title attribute.

Used by:
  • function

wrap

None

Either soft, hard, virtual, physical or off.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  1. function

  1. function

  2. function

-/-

-/-

th

<th> compound widget for table creation.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

colspan

required/ not set

Value of colspan attribute.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

id

required/ not set

Value of id attribute.

Used by:
  • function

label

required/ not set

Explicit th content. If absent, rendered markup from downstream blueprint(s) is used.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

rowspan

required/ not set

Value of rowspan attribute.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

-/-

  1. function

  1. function

-/-

-/-

thead

<thead> compound widget for table creation.

Properties

name

default

description

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

time

Add-on blueprint yafowil.widget.datetime .

Properties

name

default

description

class

'time'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

daytime

False

Flag whether value is day of time. Setting this property or ‘timepicker’ property above to True results in day time range validation.

Used by:
  • function

disabled

False

Disables input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

format

'string'

Define widget value and extraction format. Either ‘string’, ‘number’ or ‘tuple’.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

timeinput_class

'timeinput'

CSS class rendered on time input field.

timepicker

False

Flag whether time picker is enabled.

Used by:
  • function

timepicker_class

'timepicker'

jquery.ui timepicker binds to this class.

Used by:
  • function

unit

'hours'

Only considered if ‘format’ is ‘number’. If unit is ‘hours’ value is float, otherwise integer.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  1. function

  1. function

-/-

-/-

tr

<tr> compound widget for table creation.

Properties

name

default

description

class

None global

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

id

required/ not set

Value of id attribute.

Used by:
  • function

required_class

None global

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

structural

False global

If a compound is structural, it will be omitted in the dotted-path levels and will not have an own runtime-data.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  1. function

  2. function

  1. function

  2. function

-/-

-/-

url

URL aka web address (HTML5) input blueprint.

Properties

name

default

description

class

'url'

Common CSS-class to put on.

Used by:
  • function

class_add

None global

Additional CSS-class to put on.

Used by:
  • function

display_proxy

False global

If ‘True’ and widget mode ‘display’, widget value gets rendered as hidden input.

Used by:
  • function

emptyvalue

required/ not set

If configured and received value in request is empty, return as extracted value.

Used by:
  • function

error_class

None global

CSS-class to put on in case of error.

Used by:
  • function

error_class_default

'error' global

Fallback CSS-class to put on in case of error if no specific class was given.

Used by:
  • function

required

False global

Whether this value is required or not.

Used by:
  • function

required_class

'required'

CSS-class to put on in case if required condition was not met.

Used by:
  • function

required_class_default

'required' global

CSS-class to apply if required condition was not met - if no specific class was given.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

template

'%s' global

Format string with pythons built-in string format template. If a callable is given it will be used instead and is called with widget and data as parameters.

Used by:
  • function

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  3. function

  4. function

  1. function

  1. function

  2. function

-/-

-/-

wysihtml5

Add-on blueprint yafowil.widget.wysihtml5 .

Properties

name

default

description

color

None

Show the color styles toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

cols

80

Number of characters.

emphasis

None

Show the emphasis toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

font-styles

None

Show the font styles toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

html

None

Show the html toolbar button. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

image

None

Show the image toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

justify

None

Show the justify styles toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

link

None

Show the link toolbar button. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

lists

None

Show the list toolbar buttons. Options: bootstrap-wysihtml5. Values: [True|False|None (use default)].

Used by:
  • function

readonly

None

Flag for readonly.

required

False global

Whether this value is required or not.

Used by:
  • function

required_message

'Mandatory field was empty' global

Message to be shown if required condition was not met.

Used by:
  • function

rows

10

Number of lines.

size

None

Size of toolbar buttons. Options: bootstrap-wysihtml5. Values: [‘lg’|’sm’|’sx’|None (default)].

Used by:
  • function

wrap

None

Either soft, hard, virtual, physical or off.

Chains

extractors

edit renderers

display renderers

preprocessors

builders

  1. function

  2. function

  1. function

  1. function

-/-

-/-