hackforla / hackforla/peopledepot
Rename `sponsor_partner` to `affiliate`
- Dominant language
- Python
- Stars
- 14
- Forks
- 37
- Avg merge
- 9d 15h
- Merged PRs (30d)
- 5
Description
### 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
- [ ] rename `sponsor_partner` to `affiliate`
- [x] rename `project_sponsor_partner_xref` to `affiliation`. Made part of #65
- [x] convert the `is_sponsor` field name to `type` and make it a choice or enum. Made part of #65
### Resources/Instructions
- Spreadsheet: [PD: Table and field explanations, Current Field Permission tab](https://docs.google.com/spreadsheets/d/1x_zZ8JLS2hO-zG0jUocOJmX16jh-DF5dccrd_OEGNZ0/edit?gid=749942651)
#### 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 https://github.com/hackforla/peopledepot/pull/270#discussion_r1529113443_
Contributor guide
Assessment
This issue has not been assessed yet.