Merge pull request #2 from magnum-opus-tender-hack/hint

add service
This commit is contained in:
Ilia vasilenko 2022-10-21 23:37:49 +03:00 committed by GitHub
commit 7b3b3391d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,8 @@
from search.models import Product, Category
def get_hints(content: str) -> str:
category = 'Unknown'
if content in list(map(lambda product: product.name, Product.objects.all())):
category = 'Name'
return category