From 59fd2dc98cc4d470149a3790174b511bc5b0d1ed Mon Sep 17 00:00:00 2001 From: Viggo de Vries Date: Sun, 22 Sep 2024 10:23:05 +0200 Subject: [PATCH 1/2] Add count property to support stock django-oscar templates! --- oscar_elasticsearch/search/facets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oscar_elasticsearch/search/facets.py b/oscar_elasticsearch/search/facets.py index 8801a68..eb35e7c 100644 --- a/oscar_elasticsearch/search/facets.py +++ b/oscar_elasticsearch/search/facets.py @@ -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}" From 014bc7931732fdaa1107c0d6b47e47100fce3173 Mon Sep 17 00:00:00 2001 From: Viggo de Vries Date: Sun, 22 Sep 2024 10:26:18 +0200 Subject: [PATCH 2/2] we need the alpha --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 35a12cb..a1d1e55 100644 --- a/setup.py +++ b/setup.py @@ -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",