zimmerman-team / IATI.cloud

IATI datastore powered by Apache Solr. Automatically Extracts and parses IATI XML files referenced in the IATI Registry & refreshed every 3 hrs. IATI is a global initiative to improve the transparency of development and humanitarian resources and their results for addressing poverty and crises.
https://datastore.iati.cloud
MIT License
32 stars 28 forks source link

Only url friendly iati identifier is stored after activity.id auto_increment #381

Closed VincentVW closed 7 years ago

VincentVW commented 7 years ago

@bryanph regression we'll need to fix before release.

Currently only the 'normalized' version is stored, not the iati identifier that actually appears in the IATI XML source. We need both I think;

-The normalized version for querying (this used to be the activity.id) . -Original iati-identifier for displaying + export.

Hopefully there's some good internet in Dar so we can go through this on Monday :)

We might also want to look at how to implement that iati-identifier prefix rule since we store some odd iati identifiers now (might be better to put in a new ticket?);

This MUST be prefixed with EITHER the current IATI organisation identifier for the reporting organisation (reporting-org/@ref) OR a previous identifier reported in other-identifier, and suffixed with the organisation’s own activity identifier. The prefix and the suffix should be separated by a hyphen “-”.

VincentVW commented 7 years ago

I'll pick this up, we should fix this by not "normalizing" that iati identifier at all and instead urlencoding / using proper url regexes.

VincentVW commented 7 years ago

2 things on the to do list to get this working:

-Fix the regex of the URL's (allow any character) -Somehow get this to work with the comma separated filters. The problem is that when a comma occurs in the activity id (which is valid) we cannot use the comma separated filter since it cannot distinguish between the comma in the activity.iati_identifier and the comma used for separation in the filter. A rule could be that inserted values should be URL encoded and separators should not? Not sure if that is achievable nor desirable.

bryanph commented 7 years ago

I guess that is a front-end problem then no? If the user encodes the id there should be no problem (hopefully)?

VincentVW commented 7 years ago

@bryanph our comma separated filter can't distinguish between encoded comma's and non-encoded comma's. If it could, we could leave it to the front-ends to do their encoding right.

Does it make sense what I'm suggesting here?

Example of suggestion: use case is to get the activities endpoint to return activities for activity id's NL-KVK-1-idwith,comma and NL-KVK-1-idwithoutcomma

/api/activities/?activity_id=NL-KVK-1-idwith%2Ccomma,NL-KVK-1-idwithoutcomma

bryanph commented 7 years ago

@VincentVW yes the problem is that the URL is already decoded when the array split(',') happens

VincentVW commented 7 years ago

Indeed, would have to happen higher up the inheritance chain >< But maybe we dont have to:

If we are searching for data for 1 particular activity, we dont need comma separated.

If we are filtering multiple activity id's here, its always originates from a script. Hence we could just split this in 2 filters instead of doing hacky stuff;

-iati_identifier (accepts 1 iati-identifier, urlencoded, no comma separated filter) -activity_id filter ( accepts our OIPA internal id's, comma separated )

bryanph commented 7 years ago

Here a list of iati identifiers with commas in them... [u'41122-Data, Research and Policy-456C/C0/08/100/101', u'41122-Data, Research and Policy-456C/C0/08/200/201', u'41122-Data, Research and Policy-456C/C0/08/200/202', u'41122-Data, Research and Policy-456C/C0/08/200/203', u'41122-Data, Research and Policy-456C/C0/08/300/301', u'41122-Data, Research and Policy-456C/C0/08/300/302', u'41122-Data, Research and Policy-456C/C0/08/300/303', u'41122-Data, Research and Policy-456C/C0/08/300/304', u'41122-Data, Research and Policy-456C/C0/08/300/305', u'41122-Data, Research and Policy-456C/C0/08/400/401', u'41122-Data, Research and Policy-456C/C0/08/400/402', u'41122-Data, Research and Policy-456C/C0/08/500/501', u'41122-Data, Research and Policy-456C/C0/08/500/502', u'41122-Data, Research and Policy-456C/C0/08/500/503', u'41122-Data, Research and Policy-456C/C0/08/500/504', u'41122-Data, Research and Policy-456C/C0/09/100/109', u'41122-Data, Research and Policy-456C/C0/09/100/110', u'41122-Data, Research and Policy-456C/C0/09/100/112', u'41122-Data, Research and Policy-456C/C0/09/100/113', u'41122-Data, Research and Policy-456C/C0/09/100/115', u'41122-Data, Research and Policy-456C/C0/09/200/201', u'41122-Data, Research and Policy-456C/C0/09/200/202', u'41122-Data, Research and Policy-456C/C0/09/200/203', u'41122-Data, Research and Policy-456C/C0/09/200/204', u'41122-Data, Research and Policy-456C/C0/09/200/205', u'41122-Data, Research and Policy-456C/C0/09/200/206', u'41122-Data, Research and Policy-456C/C0/09/200/207', u'41122-Data, Research and Policy-456C/C0/09/200/208', u'41122-Data, Research and Policy-456C/C0/09/200/209', u'41122-Data, Research and Policy-456C/C0/09/200/210', u'41122-Data, Research and Policy-456C/C0/09/200/212', u'41122-Data, Research and Policy-456C/C0/09/200/213', u'41122-Data, Research and Policy-456C/C0/09/200/214', u'41122-Data, Research and Policy-456C/C0/09/200/215', u'41122-Data, Research and Policy-456C/C0/09/200/216', u'41122-Data, Research and Policy-456C/C0/09/200/217', u'41122-Data, Research and Policy-456C/C0/09/200/218', u'41122-Data, Research and Policy-456C/C0/09/200/219', u'41122-Data, Research and Policy-456C/C0/09/200/220', u'41122-Data, Research and Policy-456C/C0/09/200/221', u'41122-Data, Research and Policy-456C/C0/09/200/222', u'41122-Data, Research and Policy-456C/C0/09/200/223', u'41122-Data, Research and Policy-456C/C0/09/200/224', u'41122-Data, Research and Policy-456C/C0/09/999/999', u'41122-Data, Research and Policy-456C/DM/01/001/001', u'41122-EAPRO, Thailand-420R/A0/08/002/005', u'41122-EAPRO, Thailand-420R/A0/08/002/006', u'41122-EAPRO, Thailand-420R/A0/08/002/018', u'41122-EAPRO, Thailand-420R/A0/08/002/019', u'41122-EAPRO, Thailand-420R/A0/08/003/007', u'41122-EAPRO, Thailand-420R/A0/08/003/008', u'41122-EAPRO, Thailand-420R/A0/08/003/009', u'41122-EAPRO, Thailand-420R/A0/08/003/010', u'41122-EAPRO, Thailand-420R/A0/08/003/011', u'41122-EAPRO, Thailand-420R/A0/08/003/012', u'41122-EAPRO, Thailand-420R/A0/08/003/013', u'41122-EAPRO, Thailand-420R/A0/08/003/014', u'41122-EAPRO, Thailand-420R/A0/08/003/015', u'41122-EAPRO, Thailand-420R/A0/08/003/016', u'41122-EAPRO, Thailand-420R/A0/08/003/017', u'41122-EAPRO, Thailand-420R/A0/08/800/001', u'41122-EAPRO, Thailand-420R/A0/08/800/002', u'41122-EAPRO, Thailand-420R/A0/08/800/003', u'41122-EAPRO, Thailand-420R/A0/08/800/888', u'41122-EAPRO, Thailand-420R/A0/09/202/006', u'41122-EAPRO, Thailand-420R/A0/09/202/007', u'41122-EAPRO, Thailand-420R/A0/09/202/008', u'41122-EAPRO, Thailand-420R/A0/09/202/009', u'41122-EAPRO, Thailand-420R/A0/09/202/010', u'41122-EAPRO, Thailand-420R/A0/09/202/011', u'41122-EAPRO, Thailand-420R/A0/09/203/009', u'41122-EAPRO, Thailand-420R/A0/09/203/010', u'41122-EAPRO, Thailand-420R/A0/09/203/011', u'41122-EAPRO, Thailand-420R/A0/09/203/012', u'41122-EAPRO, Thailand-420R/A0/09/203/013', u'41122-EAPRO, Thailand-420R/A0/09/203/014', u'41122-EAPRO, Thailand-420R/A0/09/203/015', u'41122-EAPRO, Thailand-420R/A0/09/203/016', u'41122-EAPRO, Thailand-420R/A0/09/203/017', u'41122-EAPRO, Thailand-420R/A0/09/203/018', u'41122-EAPRO, Thailand-420R/A0/09/203/019', u'41122-EAPRO, Thailand-420R/A0/09/203/021', u'41122-EAPRO, Thailand-420R/A0/09/203/022', u'41122-EAPRO, Thailand-420R/A0/09/203/023', u'41122-EAPRO, Thailand-420R/A0/09/203/024', u'41122-EAPRO, Thailand-420R/A0/09/203/025', u'41122-EAPRO, Thailand-420R/A0/09/203/026', u'41122-EAPRO, Thailand-420R/A0/09/203/028', u'41122-EAPRO, Thailand-420R/A0/09/203/029', u'41122-EAPRO, Thailand-420R/A0/09/203/030', u'41122-EAPRO, Thailand-420R/A0/09/203/031', u'41122-EAPRO, Thailand-420R/A0/09/203/032', u'41122-EAPRO, Thailand-420R/DM/01/001/001', u'41122-EAPRO, Thailand-420R/DM/01/800/999', u'41122-ESARO, Kenya-240R/A0/08/001/001', u'41122-ESARO, Kenya-240R/A0/08/001/002', u'41122-ESARO, Kenya-240R/A0/08/001/003', u'41122-ESARO, Kenya-240R/A0/08/001/004', u'41122-ESARO, Kenya-240R/A0/08/001/005', u'41122-ESARO, Kenya-240R/A0/08/001/006', u'41122-ESARO, Kenya-240R/A0/08/001/007', u'41122-ESARO, Kenya-240R/A0/08/001/008', u'41122-ESARO, Kenya-240R/A0/08/001/009', u'41122-ESARO, Kenya-240R/A0/08/001/010', u'41122-ESARO, Kenya-240R/A0/08/001/011', u'41122-ESARO, Kenya-240R/A0/08/001/012', u'41122-ESARO, Kenya-240R/A0/08/001/013', u'41122-ESARO, Kenya-240R/A0/08/001/014', u'41122-ESARO, Kenya-240R/A0/08/001/015', u'41122-ESARO, Kenya-240R/A0/08/001/016', u'41122-ESARO, Kenya-240R/A0/08/001/017', u'41122-ESARO, Kenya-240R/A0/08/001/019', u'41122-ESARO, Kenya-240R/A0/08/002/001', u'41122-ESARO, Kenya-240R/A0/08/002/002', u'41122-ESARO, Kenya-240R/A0/08/002/003', u'41122-ESARO, Kenya-240R/A0/08/002/004', u'41122-ESARO, Kenya-240R/A0/08/002/005', u'41122-ESARO, Kenya-240R/A0/08/800/001', u'41122-ESARO, Kenya-240R/A0/08/800/002', u'41122-ESARO, Kenya-240R/A0/08/800/003', u'41122-ESARO, Kenya-240R/A0/08/800/888', u'41122-ESARO, Kenya-240R/A0/09/001/001', u'41122-ESARO, Kenya-240R/A0/09/001/002', u'41122-ESARO, Kenya-240R/A0/09/001/003', u'41122-ESARO, Kenya-240R/A0/09/001/004', u'41122-ESARO, Kenya-240R/A0/09/001/005', u'41122-ESARO, Kenya-240R/A0/09/001/006', u'41122-ESARO, Kenya-240R/A0/09/001/007', u'41122-ESARO, Kenya-240R/A0/09/001/008', u'41122-ESARO, Kenya-240R/A0/09/001/009', u'41122-ESARO, Kenya-240R/A0/09/001/010', u'41122-ESARO, Kenya-240R/A0/09/002/001', u'41122-ESARO, Kenya-240R/A0/09/002/002', u'41122-ESARO, Kenya-240R/A0/09/002/003', u'41122-ESARO, Kenya-240R/A0/09/002/004', u'41122-ESARO, Kenya-240R/A0/09/002/005', u'41122-ESARO, Kenya-240R/A0/09/002/007', u'41122-ESARO, Kenya-240R/A0/09/800/001', u'41122-ESARO, Kenya-240R/A0/09/800/002', u'41122-ESARO, Kenya-240R/A0/09/800/003', u'41122-ESARO, Kenya-240R/DM/01/001/001', u'41122-ESARO, Kenya-240R/DM/01/800/999', u'41122-LACRO, Panama-333R/A0/08/200/201', u'41122-LACRO, Panama-333R/A0/08/200/202', u'41122-LACRO, Panama-333R/A0/08/200/203', u'41122-LACRO, Panama-333R/A0/08/200/204', u'41122-LACRO, Panama-333R/A0/08/200/205', u'41122-LACRO, Panama-333R/A0/08/200/206', u'41122-LACRO, Panama-333R/A0/08/200/207', u'41122-LACRO, Panama-333R/A0/08/300/302', u'41122-LACRO, Panama-333R/A0/08/300/303', u'41122-LACRO, Panama-333R/A0/08/800/001', u'41122-LACRO, Panama-333R/A0/08/800/003', u'41122-LACRO, Panama-333R/A0/09/001/001', u'41122-LACRO, Panama-333R/A0/09/001/002', u'41122-LACRO, Panama-333R/A0/09/001/003', u'41122-LACRO, Panama-333R/A0/09/001/004', u'41122-LACRO, Panama-333R/A0/09/001/005', u'41122-LACRO, Panama-333R/A0/09/001/006', u'41122-LACRO, Panama-333R/A0/09/001/007', u'41122-LACRO, Panama-333R/A0/09/001/008', u'41122-LACRO, Panama-333R/A0/09/001/009', u'41122-LACRO, Panama-333R/A0/09/002/001', u'41122-LACRO, Panama-333R/A0/09/002/002', u'41122-LACRO, Panama-333R/A0/09/002/003', u'41122-LACRO, Panama-333R/A0/09/002/004', u'41122-LACRO, Panama-333R/A0/09/002/005', u'41122-LACRO, Panama-333R/A0/09/777/001', u'41122-LACRO, Panama-333R/A0/09/777/002', u'41122-LACRO, Panama-333R/A0/09/800/001', u'41122-LACRO, Panama-333R/A0/09/800/002', u'41122-LACRO, Panama-333R/A0/09/800/003', u'41122-LACRO, Panama-333R/A0/09/800/600', u'41122-LACRO, Panama-333R/DM/01/001/001', u'41122-LACRO, Panama-333R/DM/01/800/999', u'41122-MENA, Jordan-234R/A0/08/001/001', u'41122-MENA, Jordan-234R/A0/08/002/001', u'41122-MENA, Jordan-234R/A0/08/003/001', u'41122-MENA, Jordan-234R/A0/08/003/002', u'41122-MENA, Jordan-234R/A0/08/003/003', u'41122-MENA, Jordan-234R/A0/08/003/004', u'41122-MENA, Jordan-234R/A0/08/003/005', u'41122-MENA, Jordan-234R/A0/08/003/006', u'41122-MENA, Jordan-234R/A0/08/003/007', u'41122-MENA, Jordan-234R/A0/08/003/008', u'41122-MENA, Jordan-234R/A0/08/003/009', u'41122-MENA, Jordan-234R/A0/08/003/010', u'41122-MENA, Jordan-234R/A0/08/003/011', u'41122-MENA, Jordan-234R/A0/08/005/001', u'41122-MENA, Jordan-234R/A0/08/005/002', u'41122-MENA, Jordan-234R/A0/08/005/003', u'41122-MENA, Jordan-234R/A0/08/005/004', u'41122-MENA, Jordan-234R/A0/08/005/005', u'41122-MENA, Jordan-234R/A0/08/005/006', u'41122-MENA, Jordan-234R/A0/08/005/007', u'41122-MENA, Jordan-234R/A0/08/005/008', u'41122-MENA, Jordan-234R/A0/08/005/009', u'41122-MENA, Jordan-234R/A0/08/005/010', u'41122-MENA, Jordan-234R/A0/08/005/011', u'41122-MENA, Jordan-234R/A0/08/800/001', u'41122-MENA, Jordan-234R/A0/08/800/003', u'41122-MENA, Jordan-234R/A0/08/800/888', u'41122-MENA, Jordan-234R/A0/08/900/001', u'41122-MENA, Jordan-234R/A0/08/900/002', u'41122-MENA, Jordan-234R/A0/09/001/001', u'41122-MENA, Jordan-234R/A0/09/001/002', u'41122-MENA, Jordan-234R/A0/09/001/003', u'41122-MENA, Jordan-234R/A0/09/001/004', u'41122-MENA, Jordan-234R/A0/09/001/005', u'41122-MENA, Jordan-234R/A0/09/001/006', u'41122-MENA, Jordan-234R/A0/09/001/007', u'41122-MENA, Jordan-234R/A0/09/001/008', u'41122-MENA, Jordan-234R/A0/09/001/009', u'41122-MENA, Jordan-234R/A0/09/001/010', u'41122-MENA, Jordan-234R/A0/09/001/011', u'41122-MENA, Jordan-234R/A0/09/001/012', u'41122-MENA, Jordan-234R/A0/09/001/013', u'41122-MENA, Jordan-234R/A0/09/001/014', u'41122-MENA, Jordan-234R/A0/09/002/002', u'41122-MENA, Jordan-234R/A0/09/002/003', u'41122-MENA, Jordan-234R/A0/09/002/004', u'41122-MENA, Jordan-234R/A0/09/002/005', u'41122-MENA, Jordan-234R/A0/09/002/007', u'41122-MENA, Jordan-234R/A0/09/002/022', u'41122-MENA, Jordan-234R/A0/09/002/025', u'41122-MENA, Jordan-234R/A0/09/003/001', u'41122-MENA, Jordan-234R/A0/09/003/002', u'41122-MENA, Jordan-234R/A0/09/003/003', u'41122-MENA, Jordan-234R/A0/09/003/004', u'41122-MENA, Jordan-234R/A0/09/003/005', u'41122-MENA, Jordan-234R/A0/09/003/006', u'41122-MENA, Jordan-234R/A0/09/003/007', u'41122-MENA, Jordan-234R/A0/09/004/001', u'41122-MENA, Jordan-234R/A0/09/004/002', u'41122-MENA, Jordan-234R/A0/09/004/003', u'41122-MENA, Jordan-234R/A0/09/004/004', u'41122-MENA, Jordan-234R/A0/09/004/005', u'41122-MENA, Jordan-234R/A0/09/004/006', u'41122-MENA, Jordan-234R/A0/09/004/007', u'41122-MENA, Jordan-234R/A0/09/004/008', u'41122-MENA, Jordan-234R/A0/09/004/009', u'41122-MENA, Jordan-234R/A0/09/004/010', u'41122-MENA, Jordan-234R/A0/09/004/011', u'41122-MENA, Jordan-234R/A0/09/004/012', u'41122-MENA, Jordan-234R/A0/09/004/013', u'41122-MENA, Jordan-234R/A0/09/004/014', u'41122-MENA, Jordan-234R/A0/09/004/015', u'41122-MENA, Jordan-234R/A0/09/800/001', u'41122-MENA, Jordan-234R/A0/09/800/002', u'41122-MENA, Jordan-234R/DM/01/001/001', u'41122-MENA, Jordan-234R/DM/01/800/999', u'41122-Office of Research, Italy-2220/A0/08/001/001', u'41122-Office of Research, Italy-2220/A0/08/001/002', u'41122-Office of Research, Italy-2220/A0/08/002/001', u'41122-Office of Research, Italy-2220/A0/08/002/002', u'41122-Office of Research, Italy-2220/A0/09/001/001', u'41122-Office of Research, Italy-2220/A0/09/001/002', u'41122-Office of Research, Italy-2220/A0/09/001/003', u'41122-Office of Research, Italy-2220/A0/09/001/004', u'41122-Office of Research, Italy-2220/A0/09/002/001', u'41122-Office of Research, Italy-2220/A0/09/002/002', u'41122-Office of Research, Italy-2220/A0/09/002/003', u'41122-Office of Research, Italy-2220/A0/09/003/001', u'41122-Office of Research, Italy-2220/A0/09/003/002', u'41122-Office of Research, Italy-2220/A0/09/003/003', u'41122-Office of Research, Italy-2220/A0/09/003/004', u'41122-Office of Research, Italy-2220/DM/01/001/001', u'41122-Office of Research, Italy-2220/DM/01/999/999', u'41122-Palestine, State of-7050/DM/02/001/001', u'41122-Palestine, State of-7050/PC/06/001/001', u'41122-Palestine, State of-7050/PC/06/001/002', u'41122-Palestine, State of-7050/PC/06/002/001', u'41122-Palestine, State of-7050/PC/06/002/002', u'41122-Palestine, State of-7050/PC/06/003/001', u'41122-Palestine, State of-7050/PC/06/003/002', u'41122-Palestine, State of-7050/PC/06/003/003', u'41122-Palestine, State of-7050/PC/06/003/004', u'41122-Palestine, State of-7050/PC/06/004/001', u'41122-Palestine, State of-7050/PC/06/004/002', u'41122-Palestine, State of-7050/PC/06/004/003', u'41122-Palestine, State of-7050/PC/06/005/001', u'41122-Palestine, State of-7050/PC/06/005/002', u'41122-Palestine, State of-7050/PC/06/005/003', u'41122-Palestine, State of-7050/PC/06/006/001', u'41122-Palestine, State of-7050/PC/06/006/002', u'41122-Palestine, State of-7050/PC/06/006/003', u'41122-Palestine, State of-7050/PC/06/007/001', u'41122-Palestine, State of-7050/PC/06/007/002', u'41122-Palestine, State of-7050/PC/06/007/003', u'41122-Palestine, State of-7050/PC/06/008/001', u'41122-Palestine, State of-7050/PC/06/008/002', u'41122-Palestine, State of-7050/PC/06/008/003', u'41122-Palestine, State of-7050/PC/06/800/001', u'41122-Palestine, State of-7050/PC/06/800/002', u'41122-Palestine, State of-7050/PC/06/800/003', u'41122-Palestine, State of-7050/PC/06/800/888', u'41122-Palestine, State of-7050/PC/06/800/999', u'41122-Palestine, State of-7050/PC/06/880/001', u'41122-Palestine, State of-7050/PC/06/880/002', u'41122-Palestine, State of-7050/PC/07/001/001', u'41122-Palestine, State of-7050/PC/07/001/002', u'41122-Palestine, State of-7050/PC/07/002/001', u'41122-Palestine, State of-7050/PC/07/002/002', u'41122-Palestine, State of-7050/PC/07/002/003', u'41122-Palestine, State of-7050/PC/07/002/004', u'41122-Palestine, State of-7050/PC/07/003/001', u'41122-Palestine, State of-7050/PC/07/003/002', u'41122-Palestine, State of-7050/PC/07/004/001', u'41122-Palestine, State of-7050/PC/07/004/002', u'41122-Palestine, State of-7050/PC/07/004/003', u'41122-Palestine, State of-7050/PC/07/005/001', u'41122-Palestine, State of-7050/PC/07/005/002', u'41122-Palestine, State of-7050/PC/07/005/003', u'41122-Palestine, State of-7050/PC/07/006/001', u'41122-Palestine, State of-7050/PC/07/006/002', u'41122-Palestine, State of-7050/PC/07/006/003', u'41122-Palestine, State of-7050/PC/07/008/001', u'41122-Palestine, State of-7050/PC/07/008/002', u'41122-Palestine, State of-7050/PC/07/008/003', u'41122-Palestine, State of-7050/PC/07/880/002', u'41122-Palestine, State of-7050/PC/07/880/003', u'41122-ROSA, Nepal-297R/A0/08/002/004', u'41122-ROSA, Nepal-297R/A0/08/003/006', u'41122-ROSA, Nepal-297R/A0/08/003/007', u'41122-ROSA, Nepal-297R/A0/08/003/008', u'41122-ROSA, Nepal-297R/A0/08/003/009', u'41122-ROSA, Nepal-297R/A0/08/003/010', u'41122-ROSA, Nepal-297R/A0/08/003/011', u'41122-ROSA, Nepal-297R/A0/08/003/012', u'41122-ROSA, Nepal-297R/A0/08/003/013', u'41122-ROSA, Nepal-297R/A0/08/003/014', u'41122-ROSA, Nepal-297R/A0/08/003/015', u'41122-ROSA, Nepal-297R/A0/08/800/002', u'41122-ROSA, Nepal-297R/A0/08/800/888', u'41122-ROSA, Nepal-297R/A0/09/002/010', u'41122-ROSA, Nepal-297R/A0/09/002/011', u'41122-ROSA, Nepal-297R/A0/09/002/012', u'41122-ROSA, Nepal-297R/A0/09/002/014', u'41122-ROSA, Nepal-297R/A0/09/002/015', u'41122-ROSA, Nepal-297R/A0/09/002/016', u'41122-ROSA, Nepal-297R/A0/09/002/017', u'41122-ROSA, Nepal-297R/A0/09/002/018', u'41122-ROSA, Nepal-297R/A0/09/002/019', u'41122-ROSA, Nepal-297R/A0/09/002/020', u'41122-ROSA, Nepal-297R/A0/09/002/021', u'41122-ROSA, Nepal-297R/A0/09/002/022', u'41122-ROSA, Nepal-297R/A0/09/002/023', u'41122-ROSA, Nepal-297R/A0/09/002/024', u'41122-ROSA, Nepal-297R/A0/09/003/001', u'41122-ROSA, Nepal-297R/A0/09/003/004', u'41122-ROSA, Nepal-297R/A0/09/003/005', u'41122-ROSA, Nepal-297R/A0/09/003/009', u'41122-ROSA, Nepal-297R/A0/09/003/010', u'41122-ROSA, Nepal-297R/A0/09/003/011', u'41122-ROSA, Nepal-297R/A0/09/003/012', u'41122-ROSA, Nepal-297R/A0/09/003/013', u'41122-ROSA, Nepal-297R/A0/09/003/014', u'41122-ROSA, Nepal-297R/A0/09/003/015', u'41122-ROSA, Nepal-297R/A0/09/003/016', u'41122-ROSA, Nepal-297R/A0/09/003/017', u'41122-ROSA, Nepal-297R/A0/09/800/008', u'41122-ROSA, Nepal-297R/DM/01/001/001', u'41122-ROSA, Nepal-297R/DM/01/800/999', u'41122-WCARO, Senegal-381R/A0/08/700/001', u'41122-WCARO, Senegal-381R/A0/08/700/002', u'41122-WCARO, Senegal-381R/A0/08/700/003', u'41122-WCARO, Senegal-381R/A0/08/700/004', u'41122-WCARO, Senegal-381R/A0/08/700/005', u'41122-WCARO, Senegal-381R/A0/08/700/006', u'41122-WCARO, Senegal-381R/A0/08/700/007', u'41122-WCARO, Senegal-381R/A0/08/700/008', u'41122-WCARO, Senegal-381R/A0/08/700/009', u'41122-WCARO, Senegal-381R/A0/08/700/010', u'41122-WCARO, Senegal-381R/A0/08/700/011', u'41122-WCARO, Senegal-381R/A0/08/700/012', u'41122-WCARO, Senegal-381R/A0/08/700/013', u'41122-WCARO, Senegal-381R/A0/08/700/014', u'41122-WCARO, Senegal-381R/A0/08/800/001', u'41122-WCARO, Senegal-381R/A0/08/800/002', u'41122-WCARO, Senegal-381R/A0/08/800/004', u'41122-WCARO, Senegal-381R/A0/08/800/888', u'41122-WCARO, Senegal-381R/A0/09/700/001', u'41122-WCARO, Senegal-381R/A0/09/700/002', u'41122-WCARO, Senegal-381R/A0/09/700/003', u'41122-WCARO, Senegal-381R/A0/09/700/004', u'41122-WCARO, Senegal-381R/A0/09/700/005', u'41122-WCARO, Senegal-381R/A0/09/700/006', u'41122-WCARO, Senegal-381R/A0/09/700/007', u'41122-WCARO, Senegal-381R/A0/09/700/008', u'41122-WCARO, Senegal-381R/A0/09/700/009', u'41122-WCARO, Senegal-381R/A0/09/700/010', u'41122-WCARO, Senegal-381R/A0/09/700/011', u'41122-WCARO, Senegal-381R/A0/09/700/012', u'41122-WCARO, Senegal-381R/A0/09/700/013', u'41122-WCARO, Senegal-381R/A0/09/700/014', u'41122-WCARO, Senegal-381R/A0/09/700/015', u'41122-WCARO, Senegal-381R/A0/09/700/016', u'41122-WCARO, Senegal-381R/A0/09/800/001', u'41122-WCARO, Senegal-381R/A0/09/800/002', u'41122-WCARO, Senegal-381R/A0/09/800/003', u'41122-WCARO, Senegal-381R/A0/09/900/001', u'41122-WCARO, Senegal-381R/A0/09/900/002', u'41122-WCARO, Senegal-381R/A0/09/900/003', u'41122-WCARO, Senegal-381R/A0/09/900/004', u'41122-WCARO, Senegal-381R/A0/09/900/005', u'41122-WCARO, Senegal-381R/A0/09/900/006', u'41122-WCARO, Senegal-381R/A0/09/999/999', u'41122-WCARO, Senegal-381R/DM/01/001/001', u'41122-WCARO, Senegal-381R/DM/01/800/999', u'FI-3-2008-9500-Securities,TotalNon-banks', u'MW-CNM-21-Improving Household Food Security and General Livelihoods for 6,000 HIV and AIDS affected Women Farmers in Blantyre Rural District of Malawi', u'NL-KVK-41213450-LBBF2014,2015']

bryanph commented 7 years ago

@VincentVW Yes seems like a good approach. What is the use case for comma separated filters actually?

Might want to put this forward to iati forums to not allow comma's as well since it just ends up in ridiculous identifiers like the ones above

VincentVW commented 7 years ago

@bryanph for some publishing strategies it makes sense, like for DFID. They have the h1 project and h2 components. The h2's contain all transactions which they want to show on their h1 page.

So to load this page: https://devtracker.dfid.gov.uk/projects/GB-1-202035/transactions they use transactions/?activity_id=GB-1-202035-101,GB-1-202035-102,etc

VincentVW commented 7 years ago

they could just use transactions/?related_activity_id=GB-1-20235 (bit hacky) or get the OIPA id's from the related_activities in GB-1-20235 and use them to query by OIPA id (transactions/?related_activity_id=1234,12345,etc.)

bryanph commented 7 years ago

@VincentVW aren't they already doing that but instead picking the iati_identifiers? (maybe they use the id as it was also the iati_identifier?) Also, we could make it filter on activity pk, which filters on both id and iati_identifier (https://github.com/zimmerman-zimmerman/OIPA/blob/develop/OIPA/iati/activity_manager.py#L8)

bryanph commented 7 years ago

relace with COMMA and store as normalized iati-identifier. Also, don't normalize the iati identifier when saving it as the original. Instead, have a validation method in place

bryanph commented 7 years ago

added this in 8cd3093e5aeee330b3dbf9609e9c03a447f78cad , 8d4dddcae264098ea50c25e41dcd0f01e20e6d05, b73dacee09d2faa0b775f15fc3f320a1d6453d4e

VincentVW commented 7 years ago

@bryanph just tried to parse a file with whats currently on dev,

ProgrammingError: column iati_activity.normalized_iati_identifier does not exist LINE 1: ...ctivity"."id", "iati_activity"."iati_identifier", "iati_acti... ^

does it miss a migration or is there a code error on this?

bryanph commented 7 years ago

@VincentVW yes i just pushed them

VincentVW commented 7 years ago

@bryanph ok 👍

bryanph commented 7 years ago

Will close this for now unless issues pop up