Widget Base for rendering item-related fields.
These widgets work with Choice fields and Sequence fields that have Choice as value_type.
cssClass
(type:
unicode
)
u''
extra
(type:
str
)
''
size
(type:
int
)
5
tag
(type:
str
)
'select'
type
(type:
unicode
)
u'text'
visible
(type:
bool
)
True
hint(...)
label(...)
applyChanges(content)
convertTokensToValues(tokens)
Convert term tokens to the terms themselves.
Tokens are used in the HTML form to represent terms. This method takes the form tokens and converts them back to terms.
error()
getInputValue()
hasInput()
Check whether we have any input.
hasValidInput()
hidden()
renderItem(index, text, value, name, cssClass)
Render an item for a particular value.
renderItemsWithValues(values)
Render the list of possible values, with those found in values being marked as selected.
renderSelectedItem(index, text, value, name, cssClass)
Render an item for a particular value that is selected.
setPrefix(prefix)
Set the prefix of the input name.
Once we set the prefix of input field, we use the name of the input field and the postfix '-query' for the associated query view.
setRenderedValue(value)
textForValue(term)
Extract a string from the term.
The term must be a vocabulary tokenized term.
This can be overridden to support more complex term objects. The token is returned here since it's the only thing known to be a string, or str()able.
translate(msgid)