We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f9e06a commit 7735a64Copy full SHA for 7735a64
1 file changed
rating_api/models/db.py
@@ -144,12 +144,14 @@ def search_by_user_id(self, query: int) -> bool:
144
if not query:
145
return true()
146
return Comment.user_id == query
147
+
148
@hybrid_method
149
def search_by_subject(self, query: str) -> bool:
150
151
152
return func.lower(Comment.subject).contains(query)
153
154
155
class LecturerUserComment(BaseDbModel):
156
id: Mapped[int] = mapped_column(Integer, primary_key=True)
157
user_id: Mapped[int] = mapped_column(Integer, nullable=False)
0 commit comments