mirror of
https://github.com/davegallant/rfd.git
synced 2026-01-11 04:44:06 +00:00
13
rfd/search.py
Normal file
13
rfd/search.py
Normal file
@@ -0,0 +1,13 @@
|
||||
def search_threads(threads, keyword=None):
|
||||
"""Match deal title and dealer names with keyword specified."""
|
||||
|
||||
if keyword is None:
|
||||
return
|
||||
|
||||
keyword = str(keyword)
|
||||
|
||||
for deal in threads:
|
||||
if keyword.lower() in deal.title.lower() or (
|
||||
deal.dealer_name and keyword.lower() in deal.dealer_name.lower()
|
||||
):
|
||||
yield deal
|
||||
Reference in New Issue
Block a user