When a user downstream downloads/consumes a grant from any of the tools we need to be able to show what fields are under what licence on a per-grant basis (this is because it's possible to construct queries that mix and match grants from different datasets, or consume single grants at a time).
Tasks for this
[ ] 1. Pass through the publisher's licence information to a new field grant->additional_data->metadata->grant_licence (might be a better name than grant_licence).
The licence information for a grant can be found following the relations in the data model fields grant->(foreign key)source_file->data->licence_name. A new datastore additional_data source
We could either join the field in the ORM i.e.on the database query for export and merge in the field, or do a lookup per grant (with a cache), this would be a new datastore additional_data module called "grant_metadata" (trying to future proof this for more future fields such as #157).
When a user downstream downloads/consumes a grant from any of the tools we need to be able to show what fields are under what licence on a per-grant basis (this is because it's possible to construct queries that mix and match grants from different datasets, or consume single grants at a time).
Tasks for this
grant->additional_data->metadata->grant_licence
(might be a better name thangrant_licence
).The licence information for a grant can be found following the relations in the data model fields
grant
->(foreign key)source_file
->data
->licence_name
. A new datastore additional_data sourceWe could either join the field in the ORM i.e.on the database query for export and merge in the field, or do a lookup per grant (with a cache), this would be a new datastore
additional_data
module called "grant_metadata" (trying to future proof this for more future fields such as #157).[ ] 2. Audit the
additional_data
sources to find out which licences are in use for which fields https://github.com/ThreeSixtyGiving/datastore/tree/live/datastore/additional_data/sources[ ] 3. In each of the
additional_data
sources add a field that contains the licence informationFor example in https://github.com/ThreeSixtyGiving/datastore/blob/live/datastore/additional_data/sources/find_that_charity.py in
update_additional_data
function we need to do something likeThe task after this is to make sure the tools include the new fields in the download/api/etc.