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

Allow filtering by MP / MLA Constituencies on Story Dashboard #525

Open
batpad opened this issue May 13, 2015 · 10 comments
Open

Allow filtering by MP / MLA Constituencies on Story Dashboard #525

batpad opened this issue May 13, 2015 · 10 comments
Assignees
Labels
Milestone

Comments

@batpad
Copy link
Collaborator

batpad commented May 13, 2015

Nice to have.

@batpad batpad added the stories label May 13, 2015
@meghaklp
Copy link
Collaborator

Tracking this as well

@batpad batpad added this to the Sprint 9 milestone May 19, 2015
@batpad
Copy link
Collaborator Author

batpad commented May 19, 2015

Need to add this to the select2 list (easy), and allow this filtering on the API.

Assigning to @harisibrahimkv right now - to add it as a filter option in the API. @harisibrahimkv we can discuss this, should be fairly straightforward.

@harisibrahimkv
Copy link
Contributor

@batpad What are MP / MLA Constituencies in the db/models?

@batpad
Copy link
Collaborator Author

batpad commented May 26, 2015

@harisibrahimkv ah sorry for the late response here -- models are here: https://github.com/klpdotorg/dubdubdub/blob/develop/apps/schools/models/elected_reps.py#L35

My guess is the filter is something like school__schoolelectedrep__mla_const and school__schoolelectedrep__mp_const .. do you want to give it a shot?

Thanks!

@harisibrahimkv
Copy link
Contributor

@batpad Yeah, I am giving it a shot. I am assuming this filter is applicable for all three Volumes, Detail and Summary endpoints. However, will you be passing in the model_id or one of the following in order to filter for the mp or mla constituency?

elec_comm_code = models.IntegerField(blank=True, null=True)
const_ward_name = models.CharField(max_length=300, blank=True)

@harisibrahimkv
Copy link
Contributor

The backend is done. @meghaklp @batpad Take it away!

@meghaklp
Copy link
Collaborator

meghaklp commented Jun 2, 2015

What's to be done on front end? Constituencies show up in search box with the auto completion, no? @batpad

@harisibrahimkv
Copy link
Contributor

@meghaklp @batpad Oh okay. Do test it out and if the frontend is done, feel free to close the issue.

@meghaklp
Copy link
Collaborator

meghaklp commented Jun 2, 2015

Looks like the search box expects some kind of json/geojson when this request is made - "/api/v1/search"

this is the response right now and doesn't have mp mla boundaries

"properties": {"id": 8777, "name": "bangalore central", "type": "project", "school_type": "preschool"}}, {"geometry": {"type": "Point", "coordinates": [77.594376, 12.971606]}, "type": "Feature", "properties": {"id": 8778, "name": "bangalore state", "type": "project", "school_type": "preschool"}}, {"geometry": {"type": "Point", "coordinates": [77.6633084, 12.8420391]}, "type": "Feature", "properties": {"id": 8779, "name": "bangalore south(banashankari)", "type": "project", "school_type": "preschool"}}]}, "pre_schools": {"type": "FeatureCollection", "features": []}}

@harisibrahimkv
Copy link
Contributor

@meghaklp Has this been done?

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

No branches or pull requests

3 participants