shuup.front.apps.simple_search package¶
Submodules¶
shuup.front.apps.simple_search.forms module¶
-
shuup.front.apps.simple_search.forms.
get_query_words
(query)[source]¶ Get query words
Split the query into words and return a list of strings.
Returns: List of strings Return type: list
-
shuup.front.apps.simple_search.forms.
get_compiled_query
(query_string, needles)[source]¶ Get compiled query
Compile query string into
Q
objects and return it
-
shuup.front.apps.simple_search.forms.
get_product_ids_for_query_str
(request, query_str, limit, product_ids=[])[source]¶
-
class
shuup.front.apps.simple_search.forms.
FilterProductListByQuery
[source]¶ Bases:
shuup.front.utils.sorts_and_filters.ProductListFormModifier
shuup.front.apps.simple_search.settings module¶
-
shuup.front.apps.simple_search.settings.
SHUUP_SIMPLE_SEARCH_LIMIT
= 150¶ The limit number of products to be returned by the search
-
shuup.front.apps.simple_search.settings.
SHUUP_SIMPLE_SEARCH_FIELDS
= ['sku', 'translations__name', 'translations__description', 'translations__keywords']¶ List of fields to be used in products search query
shuup.front.apps.simple_search.template_helpers module¶
-
class
shuup.front.apps.simple_search.template_helpers.
TemplateHelpers
[source]¶ Bases:
object
-
name
= 'simple_search'¶
-
get_search_form
(context, template_name='shuup/simple_search/search_form.jinja')[source]¶ Get a product search form, usable e.g. for navigation bars. The
q
request parameter is used by default to pre-fill the search query field. The name of the template rendered can be overridden with thetemplate_name
parameter.Parameters: - context (jinja2.runtime.Context) – Template context
- template_name (str) – Template file name
-
shuup.front.apps.simple_search.urls module¶
shuup.front.apps.simple_search.views module¶
-
class
shuup.front.apps.simple_search.views.
SearchView
(**kwargs)[source]¶ Bases:
django.views.generic.list.ListView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
-
form_class
¶ alias of
ProductListForm
-
template_name
= 'shuup/simple_search/search.jinja'¶
-
model
¶ alias of
Product
-
context_object_name
= 'products'¶
-
Module contents¶
-
class
shuup.front.apps.simple_search.
SimpleSearchAppConfig
(*args, **kwargs)[source]¶ Bases:
shuup.apps.AppConfig
-
name
= 'shuup.front.apps.simple_search'¶
-
verbose_name
= 'Shuup Frontend - Simple Search'¶
-
label
= 'shuup_front.simple_search'¶
-
provides
= {'front_urls': ['shuup.front.apps.simple_search.urls:urlpatterns'], 'front_extend_product_list_form': ['shuup.front.apps.simple_search.forms.FilterProductListByQuery'], 'front_template_helper_namespace': ['shuup.front.apps.simple_search.template_helpers:TemplateHelpers']}¶
-