playpauseandstop / kikola

Kikola is a collection of Django's custom context processors, form fields and widgets, middlewares, model fields, reusable apps and template tags.

This URL has Read+Write access

kikola / kikola / contrib / basicsearch / settings.py
100644 30 lines (20 sloc) 1.062 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from django.conf import settings
from django.utils.translation import ugettext as _
 
 
__all__ = ('SEARCH_FORM', 'SEARCH_MODELS', 'SEARCH_QUERY_MIN_LENGTH',
           'SEARCH_QUERY_MAX_LENGTH', 'SEARCH_RESULTS_PER_PAGE')
 
 
# Full path to default ``SearchForm`` class
SEARCH_FORM = getattr(settings,
                      'SEARCH_FORM',
                      'kikola.contrib.basicsearch.forms.SearchForm')
 
# Sets up models for searching
SEARCH_MODELS = getattr(settings, 'SEARCH_MODELS', {})
 
# Default search "not found" message
SEARCH_NOT_FOUND_MESSAGE = getattr(settings,
                                   'SEARCH_NOT_FOUND_MESSAGE',
                                   _('Any objects was found by your query.'))
 
# Minimal length of search query
SEARCH_QUERY_MIN_LENGTH = getattr(settings, 'SEARCH_QUERY_MIN_LENGTH', 3)
 
# Maximal length of search query
SEARCH_QUERY_MAX_LENGTH = getattr(settings, 'SEARCH_QUERY_MAX_LENGTH', 64)
 
# Number of search results, rendering at search page
SEARCH_RESULTS_PER_PAGE = getattr(settings, 'SEARCH_RESULTS_PER_PAGE', 10)