backend/app/search/services/search.py

6 lines
166 B
Python
Raw Normal View History

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