Skip to content
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

Use parameters in query to get specific meps from the API #25

Open
okhin opened this issue May 24, 2016 · 4 comments
Open

Use parameters in query to get specific meps from the API #25

okhin opened this issue May 24, 2016 · 4 comments
Assignees

Comments

@okhin
Copy link

okhin commented May 24, 2016

It would be very nice if we could be able to retrieve all representatives matching some criteria.

Especially I'd like to be able to run this kind of queries:

  • All meps member of the group S&R
  • All meps member of the group S&R or in the LIBE comittee
  • All meps member of the group S&R before the 2014/07/01
  • All meps member of the LIBE committee with a score above 10 on a specific dossier

The result should be in json, listing all the representatives, in the same format they're currently listed here https://master-memopol.rhcloud.com/api/representatives/

Ideally, all of them shoudl be GET requests and those query parameters should be part of teh query parameters.

@djangocreation djangocreation self-assigned this May 24, 2016
@njoyard
Copy link
Member

njoyard commented May 24, 2016

I think we should focus on AND requests for now. Adding structured queries is quite painful and you can perform multiple AND queries instead, which will have performance on the same order of magnitude.

@djangocreation
Copy link

If we filter representative only with AND method, here is query format :

(Example)
https://master-memopol.rhcloud.com/api/representatives/?active=True&gender=1&first_name=Isabella

We do only the AND method?

@okhin
Copy link
Author

okhin commented Jun 16, 2016

It's a good start, I'd like to have a OR though.

For instance, a campaign targetting the Greens AND The alde need to have groups=GREENS&OR&groups=ALDE

And it's a use case we might encounter (or targetting multiple Committee for instance)

@njoyard
Copy link
Member

njoyard commented Jun 16, 2016

We can use for example ?groups__abbreviation__in=GREENS,ALDE or something similar. But this should be enabled in the filters first.

What would be nice would be ensuring that all possible filters are usable in the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants