Skip to content

Commit

Permalink
Merge pull request #67 from django-oscar/implement_facetdoc_count
Browse files Browse the repository at this point in the history
Add count property to support stock django-oscar templates!
  • Loading branch information
viggo-devries authored Sep 22, 2024
2 parents a66506c + 014bc79 commit 10b3653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions oscar_elasticsearch/search/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ def __init__(self, facet, key, doc_count, request_url, selected, formatter=None)
def name(self):
return self.key

@property
def count(self):
return self.doc_count

def __str__(self):
if self.formatter is not None:
return f"{self.formatter(self.key)!s}"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
install_requires=[
"django>=3.2",
"setuptools",
"django-oscar>=3.2.5",
"django-oscar>=4.0a1",
"purl",
"elasticsearch>=8.0.0",
"uwsgidecorators-fallback",
Expand Down

0 comments on commit 10b3653

Please sign in to comment.