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]
shuup.front.apps.simple_search.forms.get_search_product_ids(request, query, limit=150)[source]
class shuup.front.apps.simple_search.forms.FilterProductListByQuery[source]

Bases: shuup.front.utils.sorts_and_filters.ProductListFormModifier

should_use(configuration)[source]
get_ordering(configuration)[source]
get_fields(request, category=None)[source]
get_filters(request, data)[source]
clean_hook(form)[source]
sort_products(request, products, data)[source]

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 the template_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'
dispatch(request, *args, **kwargs)[source]
get_queryset()[source]
get_context_data(**kwargs)[source]