Skip to content

Commit

Permalink
feat ⭐ add attribute setter in product attribute container
Browse files Browse the repository at this point in the history
  • Loading branch information
samar-hassan committed Apr 23, 2024
1 parent ebb2af4 commit dea9cec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/oscar/apps/catalogue/product_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ def attribute_values(self):
.annotate(code=models.F("attribute__code"))
)

def set_attributes(self, attributes):
"""
Used in oscar odin to prefetch attributes instead of fetching against each
product.
"""
self.__dict__["attributes"] = QuerysetCache(attributes)


class ProductAttributesContainer:
"""
Expand Down

0 comments on commit dea9cec

Please sign in to comment.