MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / date_facet

Method date_facet

haystack/query.py:444–450  ·  view source on GitHub ↗

Adds faceting to a query for the provided field by date.

(self, field, start_date, end_date, gap_by, gap_amount=1)

Source from the content-addressed store, hash-verified

442 return clone
443
444 def date_facet(self, field, start_date, end_date, gap_by, gap_amount=1):
445 """Adds faceting to a query for the provided field by date."""
446 clone = self._clone()
447 clone.query.add_date_facet(
448 field, start_date, end_date, gap_by, gap_amount=gap_amount
449 )
450 return clone
451
452 def query_facet(self, field, query):
453 """Adds faceting to a query for the provided field with a custom query."""

Callers 6

get_querysetMethod · 0.45
test_date_facetsMethod · 0.45
test_date_facetsMethod · 0.45
test_date_facetMethod · 0.45
test_date_facetMethod · 0.45
test_date_facetMethod · 0.45

Calls 2

_cloneMethod · 0.95
add_date_facetMethod · 0.80

Tested by 5

test_date_facetsMethod · 0.36
test_date_facetsMethod · 0.36
test_date_facetMethod · 0.36
test_date_facetMethod · 0.36
test_date_facetMethod · 0.36