Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Add ability to specify different collection methods #113

Merged
merged 9 commits into from
Jul 5, 2013

Conversation

alexmuller
Copy link
Contributor

From Pivotal [#52056357], "Add functionality to backdrop to sum items"

This change adds an option to the collect parameter, so that you can ask for ?collect=field:sum (and a few other methods).

(Rob says: we've got some query code in database.py that shouldn't be there. Can be refactored later.)

To be more explicit about what it actually is.
Previously, any leftover fields were passed to the result record
which was misleading.

Now we don't include unspecified fields in the result.
Methods are passed in to a collect query param as field:method.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 1dfb708 on read-api-collect-maths into 9e90c73 on master.

@maxfliri
Copy link
Contributor

maxfliri commented Jul 3, 2013

If you try to collect a string property with "sum", you get the error message: "Cannot collect an invalid field name". It would be nicer to have an error message explaining the real problem.

@maxfliri
Copy link
Contributor

maxfliri commented Jul 3, 2013

If the query is using collect=field:set, would it make sense to include only the property field:set in the response? I don't think we need to keep the backwards compatible option if the request is using the new syntax.

@maxfliri
Copy link
Contributor

maxfliri commented Jul 3, 2013

Also, you have changed the readme, but there is no mention of the new feature. Should there be some documentation for it? Actually the readme may not be the ideal place for detailed documentation about the api, but in this case we should write something else, a page in the wiki for example.

alexmuller and others added 4 commits July 3, 2013 12:41
If you request field:set, you should only receive field:set
in the response, not field as well.
When you request a collect sum on a string (or similar),
you should receive a 400 bad request.
It is causing CI to fail every time. It seems to be an issue in
selenium.
https://code.google.com/p/selenium/issues/detail?id=3812
All the ways of running tests should act the same way. I would like to
have this done in just one place but I don't want to hold up this pull
request any more.
@robyoung robyoung mentioned this pull request Jul 4, 2013
@maxfliri
Copy link
Contributor

maxfliri commented Jul 5, 2013

👍

alexmuller added a commit that referenced this pull request Jul 5, 2013
Add ability to specify different collection methods
@alexmuller alexmuller merged commit 6bab23f into master Jul 5, 2013
@alexmuller alexmuller deleted the read-api-collect-maths branch July 5, 2013 09:25
alexmuller added a commit that referenced this pull request Aug 23, 2013
Add ability to specify different collection methods
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants