PopulateTools / gobierto

Plataforma de gobierno abierto open source
https://gobierto.es
GNU Affero General Public License v3.0
74 stars 32 forks source link

Plans / SDG integration #2920

Closed furilo closed 4 years ago

furilo commented 4 years ago

We are integrating the SDGs (ODS in spanish) in Plans, and probably in Budgets in the future. The idea is that things that organizations do (either reflected on plans or in budgets, and probably in other modules) are related with some ODS.

SDGs are structured in Objectives, that has many Goals, that has many Indicators. SDGs inventory: https://docs.google.com/spreadsheets/d/1iWHqO8kaUyY5BlsSu3Tz6bYSL_zPtV0B/edit#gid=571153678 - An Objetive have a description and an image (we could "fake" it with some kind of dictionary, although we would need fixed IDs for each Objective).

This is how we are integrating it on Plans:

  1. En la home mostramos un bloque con el listado de los ODSs https://www.figma.com/proto/qwGYAmtbMaeemrDfrHS0ky/1902_Gobierto_PAM?node-id=4%3A430&viewport=781%2C-4378%2C0.5&scaling=min-zoom

  2. Si pinchas en un ODS, te muestra los proyectos asociados al mismo. https://www.figma.com/proto/qwGYAmtbMaeemrDfrHS0ky/1902_Gobierto_PAM?node-id=4%3A157&viewport=781%2C-4378%2C0.5&scaling=min-zoom

  3. Desde allí puedes pinchar en un proyecto para ver su ficha (también puedes llevar a la ficha del proyecto navegando por las categorías principales). En la ficha también mostramos los ODSs a los que está vinculado el proyecto. https://www.figma.com/proto/qwGYAmtbMaeemrDfrHS0ky/1902_Gobierto_PAM?node-id=4%3A893&viewport=781%2C-4378%2C0.5&scaling=min-zoom

Thus, we need a data structure where to store the SDGs. Right now, we are mostly using Objectives, but it is likely that we need to use also Goals.

We could replicate the SDGs in a Vocabulary. Issues:

Alternatively, we could store this in a custom model with custom fields, but if we can solve it via a Vocabulary is much simpler.

@entantoencuanto @ferblape please chime in to decide how to do this.

ferblape commented 4 years ago

IMO using a vocabulary is a natural solution, for the type of data structure SDGs are and because in plan projects the relation HABTM already exists with vocabularies and terms.

To me, adding an external_id to the terms of a vocabulary is not a big deal: it can be optional and will allow us to store the specific ids of each goal and objective.

And for budget lines we should implement also a relation HABTM to vocabularies terms, and we could even try to make it generic for every model we want.

I'd also think on automating the creation of the SGDs structure for a given stie, or making it a default vocabulary for all sites.

furilo commented 4 years ago
  1. I think adding and external_id to terms, as we have done with plans, is a great idea: it will also serve to sync terms in other contexts, and for this case we can use it to store the IDs. Only comment is that for this case we need it to be a string, not an int - don't know if this is problematic.

  2. Default SDGs: yes, my idea is that we automate it's creation as we have done with the module setup scripts. We could trigger this on site creation so a SDG vocab is always available.

ferblape commented 4 years ago

Usually external ids are strings, because are more generic, so that shouldn't be a problem.

furilo commented 4 years ago

Perfect