backend/app/search/services/search.py

7 lines
194 B
Python
Raw Permalink Normal View History

2022-10-21 22:36:36 +03:00
from search.models import Product
2022-10-21 23:22:14 +03:00
from typing import List
2022-10-21 22:36:36 +03:00
2022-10-21 23:22:14 +03:00
def process_string(text: str) -> List[dict]:
2022-10-21 22:36:36 +03:00
return [x.serialize_self() for x in Product.objects.filter(name__contains=text)[5:]]