search.controllers.simple.forms module

Provides form rendering and validation for the simple search feature.

class search.controllers.simple.forms.SimpleSearchForm(formdata=None, obj=None, prefix='', data=None, meta=None, **kwargs)[source]

Bases: wtforms.form.Form

Provides a simple field-query search form.

HIDE_ABSTRACTS = 'hide'
SHOW_ABSTRACTS = 'show'
abstracts = <UnboundField(RadioField, ('Abstracts',), {'choices': [('show', 'Show abstracts'), ('hide', 'Hide abstracts')], 'default': 'show'})>
order = <UnboundField(SelectField, ('Sort results by',), {'choices': [('-announced_date_first', 'Announcement date (newest first)'), ('announced_date_first', 'Announcement date (oldest first)'), ('-submitted_date', 'Submission date (newest first)'), ('submitted_date', 'Submission date (oldest first)'), ('', 'Relevance')], 'validators': [<wtforms.validators.Optional object>], 'default': '-announced_date_first'})>
query = <UnboundField(StringField, ('Search or Article ID',), {'filters': [<function strip_white_space>], 'validators': [<function does_not_start_with_wildcard>, <function has_balanced_quotes>]})>
searchtype = <UnboundField(SelectField, ('Field',), {'choices': [('all', 'All fields'), ('title', 'Title'), ('author', 'Author(s)'), ('abstract', 'Abstract'), ('comments', 'Comments'), ('journal_ref', 'Journal reference'), ('acm_class', 'ACM classification'), ('msc_class', 'MSC classification'), ('report_num', 'Report number'), ('paper_id', 'arXiv identifier'), ('doi', 'DOI'), ('orcid', 'ORCID'), ('license', 'License (URI)'), ('author_id', 'arXiv author ID'), ('help', 'Help pages'), ('full_text', 'Full text')]})>
size = <UnboundField(SelectField, ('results per page',), {'default': 50, 'choices': [('25', '25'), ('50', '50'), ('100', '100'), ('200', '200')]})>
validate_query(field)[source]

Validate the length of the querystring, if searchtype is set.

Return type:None