Skip to content
Snippets Groups Projects
Commit 2444fcc4 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Add queries by public/exposed status for superevents

Allow queries on whether a superevent is publicly available or
not. Add documentation to the query help page.
parent 1e92e3c2
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ from pyparsing import Word, nums, Literal, CaselessLiteral, delimitedList, \
# Set up logger
logger = logging.getLogger(__name__)
# Function for parsing matched superevent ID tokens
def parse_superevent_id(name, toks, filter_prefix=None):
# toks = matched superevent id
......@@ -119,6 +120,22 @@ parameter_dicts = {
'value': Or([CaselessLiteral(b) for b in ['true', 'false']]),
'parseAction': lambda toks: ("is_gw", Q(is_gw=(toks[0] == "true"))),
},
# is_public: true|false OR is_exposed: true|false
'is_public': {
'keyword': ['is_public', 'is_exposed'],
'keywordOptional': False,
'value': Or([CaselessLiteral(b) for b in ['true', 'false']]),
'parseAction': lambda toks: ("is_exposed",
Q(is_exposed=(toks[0] == "true"))),
},
# status: internal|public OR internal|public
'public': {
'keyword': 'status',
'keywordOptional': True,
'value': Or([CaselessLiteral(b) for b in ['public', 'internal']]),
'parseAction': lambda toks: ("is_exposed",
Q(is_exposed=(toks[0] == "public"))),
},
# created: yesterday .. now (uses events.nltime.nltimeExpression)
'created_nl': {
'keyword': 'created',
......@@ -153,7 +170,6 @@ parameter_dicts = {
},
}
# Compile a list of expressions to try to match
expr_list = []
for k,p in parameter_dicts.iteritems():
......
......@@ -151,4 +151,14 @@
<h4>By label</h4>
Same as for events.
<h4>By public status</h4>
Use the <code>is_public:</code> or <code>is_exposed:</code> keywords:
<ul>
<li>is_public: True</li>
<li>is_exposed: True</li>
</ul>
Or, just add either "public" or "internal" to your query.
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment