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

[Fixes #1758 #1766] Fix for DRF API filters #1767

Merged
merged 27 commits into from
Aug 26, 2015
Merged

Conversation

KasperBrandt
Copy link
Contributor

zzgvh and others added 24 commits August 18, 2015 10:50
The PartnerType model was used to limit the types of partners that could
be added by an organisation. This is now obsolete.
Simplificate the code, remove duplicate listing of partner
type and fix punctuation and capitalization.
Partnership.partner_type

Initial sweep of the code to move uses of partner_type to the new
field iati_organisation_role.

Missing is the migration to create the new field. I'm having problems
that seem reated to multiple import paths.
The import of Partnership in iati/elements/participating_org.py at the
module level causes a runtime error when trying to create a new
migration for the Partnership model.

Fix by moving the import into the function where it's used.
Also revert imports of Partnership that were changed when trying to fix
the dual import problem.
Remove filtering key/value from PartnershipResource.Meta.filtering

Add comment to Partnership model
A number of keywords are duplicates in fuction. This migration looks
for the "old" keywords and replaces them with the "new" one.
Add some more diagnostic output

Fix label characters
Keywords that aren't used in any project are deleted.
To prepare for the removal of sponsor partners, create a keyword for
each organisation that is a sposor partner.

The keywords are of the format <org ID>:<org name> to distinguish them
from "ordinary" keywords.
Enable filtering on legacy Partnership.partner_type(_2) values in the
Tastypie PartnershipResource

NOTE: when the Partnership.partner_type field is removed, all
references to partner_type_2 should be changed to partner_type
@akvobot
Copy link

akvobot commented Aug 25, 2015

Checklist

  • Test plan
  • Copyright header
  • Code formatting
  • Documentation

@KasperBrandt KasperBrandt assigned zzgvh and unassigned zzgvh Aug 25, 2015
@KasperBrandt KasperBrandt changed the title [#1758 #1766] Fix for DRF API filters [Fixes #1758 #1766] Fix for DRF API filters Aug 26, 2015
- Renamed partner_type_2 to partner_type
- Changed the backwards compatible Extending partner to 'extending', since converting this to a support partner isn't completely correct. Also, it gave issues when trying to filter on 'support' in the API, since it then only returns the partners with the accountable role and not extending. 'Extending' isn't fully backwards compatible though, because this type didn't exist before, but only new partner could have this type.
zzgvh added a commit that referenced this pull request Aug 26, 2015
@zzgvh zzgvh merged commit 3acb098 into develop Aug 26, 2015
@zzgvh zzgvh deleted the #1766-drf-api-filters branch August 26, 2015 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants