Extract topic_column_sa().

This commit is contained in:
Steve Howell
2018-11-09 16:06:00 +00:00
committed by Tim Abbott
parent b46fb5eaad
commit 8981b65bbc
2 changed files with 9 additions and 5 deletions

View File

@@ -35,6 +35,9 @@ def topic_match_sa(topic_name: str) -> Any:
topic_cond = func.upper(column("subject")) == func.upper(literal(topic_name))
return topic_cond
def topic_column_sa() -> Any:
return column("subject")
def filter_by_exact_message_topic(query: QuerySet, message: Message) -> QuerySet:
topic_name = message.topic_name()
return query.filter(subject=topic_name)