X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3badd77f743883992829a1174eef7c8d5e851766..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/search/forms.py diff --git a/apps/search/forms.py b/apps/search/forms.py deleted file mode 100755 index e7051b86e..000000000 --- a/apps/search/forms.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from django import forms -from django.utils.translation import ugettext_lazy as _ - -from search.fields import JQueryAutoCompleteSearchField - - -class SearchForm(forms.Form): - q = JQueryAutoCompleteSearchField() # {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"}) - - def __init__(self, source, *args, **kwargs): - kwargs['auto_id'] = False - super(SearchForm, self).__init__(*args, **kwargs) - self.fields['q'].widget.attrs['id'] = _('search') - self.fields['q'].widget.attrs['autocomplete'] = _('off') - self.fields['q'].widget.attrs['data-source'] = _(source) - if not 'q' in self.data: - self.fields['q'].widget.attrs['title'] = _('title, author, theme/topic, epoch, kind, genre, phrase')