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

Add grant and additional_data licence data #213

Open
3 tasks
michaelwood opened this issue Jul 15, 2024 · 1 comment
Open
3 tasks

Add grant and additional_data licence data #213

michaelwood opened this issue Jul 15, 2024 · 1 comment
Assignees

Comments

@michaelwood
Copy link
Member

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).

For 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 like

class FindThatCharitySource(object):

#....

    LICENCE =  "whatever-it-is-v2"

#....

    def update_additional_data(self, grant, additional_data)
...


        additional_data[f"{self.ADDITIONAL_DATA_KEY}_LICENCE"] = LICENCE

The task after this is to make sure the tools include the new fields in the download/api/etc.

@rhiaro
Copy link

rhiaro commented Jul 15, 2024

(might be a better name than grant_licence)

publisher_licence or source_licence ?

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

2 participants