first try at implementing product viewset "related" action
This commit is contained in:
@@ -85,6 +85,16 @@ def extract_search_filters(result_set):
|
||||
return filter_dict
|
||||
|
||||
|
||||
def find_related_products_v7(description, tags, attributes, category):
|
||||
products_qs = Product.objects.filter(
|
||||
description=description,
|
||||
tags__in=tags,
|
||||
attributes__in=attributes,
|
||||
category=category
|
||||
)[:6]
|
||||
return products_qs
|
||||
|
||||
|
||||
def find_related_products_v3(keyword):
|
||||
"""
|
||||
Ranked product search
|
||||
|
||||
Reference in New Issue
Block a user