-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query data endpoint by submission review. Filter NULL
review status
#2144
Conversation
7486de9
to
a55a701
Compare
NULL
review status
if '$or' not in list(query): | ||
for k, v in query.items(): | ||
if v is None: | ||
or_where.extend([u"json->>'{}' IS NULL".format(k)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this functionality would not properly handle queries without the $or
query in it; Just seems to check if the value is None
and adds the query... should it handle querying the values passed in the query? or is that handled elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the query is handled in the _parse_where
function could we extend that function to handle field_value
when it's None
instead of looping through the query here perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
Made that change
28e807c
to
bb3d52d
Compare
55e23d3
bb3d52d
to
55e23d3
Compare
55e23d3
to
0437f06
Compare
…#2144) * Add failing tests * Include ability to generate sql statement for NULL query strings. * Update data endpoint documentation
* test on charts by grouping multiple fields * test on charts with content type * update the format to json when content type has been provided * styling fix * styling fix * Update onadata/apps/api/tests/viewsets/test_charts_viewset.py Co-authored-by: Davis Raymond <[email protected]> * Clean out Merged Datasets upon xform deletion. Clean out Form Media Files upon form deletion. Add documentation on clean up of filtered datasets (#2136) * Query data endpoint by submission review. Filter `NULL` review status (#2144) * Add failing tests * Include ability to generate sql statement for NULL query strings. * Update data endpoint documentation * Remove unnecessary test * test on charts by grouping multiple fields * test on charts with content type * update the format to json when content type has been provided * styling fix * styling fix * Update onadata/apps/api/tests/viewsets/test_charts_viewset.py Co-authored-by: Davis Raymond <[email protected]> * Remove unnecessary test Co-authored-by: Davis Raymond <[email protected]> Co-authored-by: Winnie Kiragu <[email protected]>
Changes / Features implemented
NULL
Steps taken to verify this change does what is intended
Side effects of having these changes
PENDING
can be thought of in 2 ways:3
- For instances when the user had already provided a status, i.e approved/rejected and would like to return submission review status to pending.NULL
- By default, if no review has been provided for the submission.Before submitting this PR for review, please make sure you have:
Closes #2112