django-oscar
  • Sample Oscar projects
  • Building your own shop
  • Building an e-commerce site: the key questions
  • Modelling your catalogue
  • Getting help
  • Glossary
  • Platform and database support
  • Customising Oscar
  • Dynamic class loading explained
  • Prices and availability
  • Deploying Oscar
  • Translation
  • Upgrading
  • Forking an app
  • Core functionality
  • Oscar's apps
    • Address
    • Analytics
    • Basket
    • Catalogue
    • Checkout
    • Communication
    • Customer
    • Dashboard
    • Offers
    • Order
    • Partner
    • Payment
    • Search
      • Views
      • Forms
        • BrowseCategoryForm
        • CategoryForm
        • SearchForm
        • SearchInput
      • Utils
        • base_sqs()
    • Shipping
    • Voucher
    • Wishlists
  • Recipes
  • Oscar settings
  • Signals
  • Template tags
  • Oscar design decisions
  • Release notes
  • Contributing to Oscar
django-oscar
  • Oscar Core Apps explained
  • Search
  • View page source

Search¶

Oscar provides a search view that extends Haystack’s FacetedSearchView to provide better support for faceting.

  • Facets are configured using the OSCAR_SEARCH_FACETS setting, which is used to configure the SearchQuerySet instance within the search application class.

  • A simple search form is injected into each template context using a context processor oscar.apps.search.context_processors.search_form.

Views¶

Forms¶

class oscar.apps.search.forms.BrowseCategoryForm(*args, **kwargs)[source]¶

Variant of SearchForm that returns all products (instead of none) if no query is specified.

property media¶

Return all media required to render the widgets on this form.

no_query_found()[source]¶

Return Queryset of all the results.

class oscar.apps.search.forms.CategoryForm(categories, *args, **kwargs)[source]¶
property media¶

Return all media required to render the widgets on this form.

no_query_found()[source]¶

Return Queryset of all the results.

class oscar.apps.search.forms.SearchForm(*args, **kwargs)[source]¶

In Haystack, the search form is used for interpreting and sub-filtering the SQS.

property media¶

Return all media required to render the widgets on this form.

property selected_multi_facets¶

Validate and return the selected facets

class oscar.apps.search.forms.SearchInput(attrs=None)[source]¶

Defining a search type widget

This is an HTML5 thing and works nicely with Safari, other browsers default back to using the default “text” type

Utils¶

oscar.apps.search.facets.base_sqs()[source]¶

Return the base SearchQuerySet for Haystack searches.

Previous Next

© Copyright .

Built with Sphinx using a theme provided by Read the Docs.