-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add level indicator field on Org to complement "Limit States" #660
Comments
@Sandro-Meireles for sites with multiple countries we show the country level only as we use the World data from ureport/ureport/public/views.py Line 466 in c8ffb88
limit_states config to only display those countries also you need to make that common.is_global = True
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Normally in a RapidPro Org, it has a map with a single country as level 0, so the states are with level 1 and cities with level 2. In our infrastructure we have some customers who have the need to contain several countries in one Rapidpro Org, in this case, the union of all countries on the map would be level 0, a specific country would be level 1, and then level 2 would be for states or districts.
Several of our U-Report instances can use a single API-Token from a RapidPro Org. So for each country where the map in Rapidpro represents level 1, can make the selection of the map using the "Limit States" filter, however, when using this limit, the query returns only the information that is at the level 1 (countries in this case), without state details (in this case, level 2). We need to list the states contained in the country limited (level 1), that is, list all those that have level 2 and that are children of the country specified by the "Limit States".
To solve this, we can add a new field for Org in
settings_common.py
, it would berequired=False
after that, to query the data in therender_to_response
method, inureport.public.views.BoundaryView
, making 1 a value default, it would be used on line 488, representing the level value to be filtered, example:ureport.public.views.BoundaryView.render_to_response
line 488The text was updated successfully, but these errors were encountered: