added flagged and unflagged query options
This commit is contained in:
committed by
GitHub
parent
ed251ce999
commit
85025b34ff
@@ -17,6 +17,8 @@ def build_search_query(**kwargs):
|
||||
|
||||
# Parse keyword arguments
|
||||
unread = kwargs.get('unread', False)
|
||||
unflagged = kwargs.get('unflagged', False)
|
||||
flagged = kwargs.get('flagged', False)
|
||||
sent_from = kwargs.get('sent_from', False)
|
||||
sent_to = kwargs.get('sent_to', False)
|
||||
date__gt = kwargs.get('date__gt', False)
|
||||
@@ -32,6 +34,12 @@ def build_search_query(**kwargs):
|
||||
if unread:
|
||||
query.append("(UNSEEN)")
|
||||
|
||||
if unflagged:
|
||||
query.append("(UNFLAGGED)")
|
||||
|
||||
if flagged:
|
||||
query.append("(FLAGGED)")
|
||||
|
||||
if sent_from:
|
||||
query.append('(FROM "%s")' % sent_from)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user