Closed
Description
I have a table called 'Client' as shown below:
class Client(Base):
__tablename__ = "client"
id: Mapped[int] = mapped_column("id", autoincrement=True, nullable=False, unique=True, primary_key=True, init=False)
name: Mapped[str] = mapped_column(String(50))
contact: Mapped[str] = mapped_column(String(50))
phone: Mapped[str] = mapped_column(String(20))
email: Mapped[str] = mapped_column(String(50))
I want to perform a search across all fields in this table using the parameter 'keyword', for example:
name__ilike = f'%{keyword}%' OR contact__ilike = f'%{keyword}%' OR phone__ilike = f'%{keyword}%' OR email__ilike = f'%{keyword}%'
In my research of the documentation, I only found a way to query an OR condition within a single field, such as price__or={'lt': 5, 'gt': 20}
. Please help me find a solution. Thank you very much!