* Field defined auto-completion function (please method documentation): Field.autocomplete(self, form, limit=50)
"""
fromwtformsimportField
frominvenio.webdeposit_formimportCFG_FIELD_FLAGS
__all__=['WebDepositField']
classWebDepositField(Field):
"""
Base field that all webdeposit fields must inherit from.
"""
def__init__(self,*args,**kwargs):
"""
Initialize WebDeposit field.
Every field is associated with a marc field. To define this association you
have to specify the `export_key` for the bibfield's `JsonReader` or
the `cook_function` (for more complicated fields).
@param placeholder: str, Placeholder text for input fields.
@param icon: Name of icon (rendering of the icon is done by templates)
@type icon: str
@param autocomplete: callable, A function to auto-complete values for field.
@param processors: list of callables, List of processors to run for field.
@param validators: list of callables, List of WTForm validators. If no validators are provided, validators defined in webdeposit_config will be loaded.
@param hidden: Set to true to hide field. Default: False
@type hidden: bool
@param disabled: Set to true to disable field. Default: False
@type disabled: bool
@param export_key: Name of key to use during export
@type export_key: str or callable
@see http://wtforms.simplecodes.com/docs/1.0.4/validators.html for
how to write validators.
@see http://wtforms.simplecodes.com/docs/1.0.4/fields.html for further
keyword argument that can be provided on field initialization.
"""
# Pop WebDeposit specific kwargs before calling super()