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

Rename sponsor_partner to affiliate #52

Closed
2 of 3 tasks
fyliu opened this issue May 30, 2024 · 0 comments
Closed
2 of 3 tasks

Rename sponsor_partner to affiliate #52

fyliu opened this issue May 30, 2024 · 0 comments

Comments

@fyliu
Copy link
Owner

fyliu commented May 30, 2024

Overview

We should rename the sponsor_partner table to something like affiliate. And the project_sponsor_partner_xref table to affiliation or similar. This would simplify and clarify the ideas behind these tables.

Also more clear would be converting the project_sponsor_partner_xref.is_sponsor field to type. See discussion below.

Action Items

ERD, spreadsheet, code changes for each of these

Resources/Instructions

Proposed Changes

  • Rename the project_sponsor_partner_xref table to affiliation or a more appropriate descriptive term for the relationship.
  • Rename the sponsor_partner table to affiliate.
  • Make is_sponsor is a choice like choose between sponsor or partner, and call it type

What the changes give us

Mostly simpler naming for these concepts.

Clearer code when working with the relationship and model.

Example to create a project-affiliate relation

Affiliation.objects.create(project="PeopleDepot", affiliate="Code for America", type="partner")

The current way would look like this

ProjectSponsorPartnerXref.objects.create(project="PeopleDepot", sponsor_partner="Code for America", is_sponsor=False)

Originally posted by @fyliu in hackforla#270 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant