You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
470 B
20 lines
470 B
import logging
|
|
|
|
from django import forms
|
|
from haystack.forms import SearchForm
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class BlogSearchForm(SearchForm):
|
|
querydata = forms.CharField(required=True)
|
|
|
|
def search(self):
|
|
datas = super(BlogSearchForm, self).search()
|
|
if not self.is_valid():
|
|
return self.no_query_found()
|
|
|
|
if self.cleaned_data['querydata']:
|
|
logger.info(self.cleaned_data['querydata'])
|
|
return datas
|