From 5b0ce01c09caa851de2a0278889f2b073d446694 Mon Sep 17 00:00:00 2001 From: Frank Hennige Date: Tue, 20 Jun 2023 16:13:27 +0200 Subject: [PATCH] Fix integer field query --- src/oscar_pg_search/filter_options/attribute_fields.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/oscar_pg_search/filter_options/attribute_fields.py b/src/oscar_pg_search/filter_options/attribute_fields.py index edf7572..43e3c67 100644 --- a/src/oscar_pg_search/filter_options/attribute_fields.py +++ b/src/oscar_pg_search/filter_options/attribute_fields.py @@ -14,7 +14,9 @@ class TextAttributeField(AttributeFieldBase): def get_query(self): if str(self.attribute.id) in self.request_data: values_list = self.request_data.getlist(str(self.attribute.id)) - if self.attribute.type in (self.attribute.TEXT, self.attribute.FLOAT): + text_fields = (self.attribute.TEXT, self.attribute.FLOAT, + self.attribute.INTEGER) + if self.attribute.type in text_fields: values = self.attribute.productattributevalue_set.filter( id__in=values_list) values = values.values_list(self.fieldname, flat=True)