generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
complexity: mediumStraightforward but some complexity (e.g., involves multiple files)Straightforward but some complexity (e.g., involves multiple files)feature: update tablerole: back ends: CTJstakeholder: Civic Tech Jobsstakeholder: Civic Tech Jobss: VRMSstakeholder: VRMSstakeholder: VRMSsize: 0.25ptCan be done in 1.5 hours or lessCan be done in 1.5 hours or less
Milestone
Description
Overview
We need to update the UserPermission table model to include new fields, update the field names, and change the table name.
Details
- The initial model issue: Create Table: user permission #22
- Discussion leading to this change is here: n/a
Action Items
- Update existing Django model
- update table name from userpermission to permission
- this will involve finding every place in the code where the table is referenced and changing it.
- In the files indicated by Resource 1.01, Change the following items in the code
| Current Name in code | Updated Name | Updated Type (may already be this type) | FK Table | FK Table Issue(s) |
|---|---|---|---|---|
| permission_type_id | permission_type | int | PermissionType | #24 |
| practice_area_id | practice_area | int | PracticeArea | #63 |
| project_id | project | int | Project | -- |
| user_id | user | int | User | -- |
- Add the following items in the code
| Name | Type | FK Table | FK Table Issue(s) |
|---|---|---|---|
| created_by | int | user | #15 & #429 & #172 |
| ended | DateTimeField | -- | -- |
| ranted | DateTimeField | -- | -- |
| updated_by | int | user | #15 & #429 & #172 |
-
Check to see if open issues in
FK statusbelow- If all Issues listed are closed (or there are no FKs), then skip the next 3 steps
- comment out the code after you create it (see FK Status below for open/closed state)
- add an action item on the open issue to uncomment the code line you commented out when that issue's table is created.
- Provide your file and line number as a permalink under resources in that issue
- If all Issues listed are closed (or there are no FKs), then skip the next 3 steps
-
Write a test for the new relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project) if any.
-
Update API end point
-
Update API unit tests
-
generate a schema table description (see resources 1.04), post it in a comment below, and add a link to it in the Update Schema dependency issue
-
Document the endpoint in ReDocs (see resources 1.05)
FK status
- Create Table: permission_type #24
- Create Table: practice_area #63
- Create Table: User #15
- Update Table: User #429
- Update Table: user (replace role association with practice area) #172
Resources
- 1.01 Code locations
- 1.01.01 /app/core/models.py
- 1.01.02 /app/core/admin.py
- 1.01.03 /app/core/api/serializers.py
- 1.01.04 /app/core/api/views.py
- 1.02 People Depot Resources wiki page for links
- ERD
- Table and Field Definitions
- API Endpoint
- 1.03 Spreadsheet: PD: Table and field explanations, tab: current Field Permissions
-1.03.01 PD: Table and field explanations, tab: current Field Permissions, filter: permission - 1.04 Instructions for how to generate a schema table description
- 1.05 Instructions for how to Document End point step 3
Metadata
Metadata
Assignees
Labels
complexity: mediumStraightforward but some complexity (e.g., involves multiple files)Straightforward but some complexity (e.g., involves multiple files)feature: update tablerole: back ends: CTJstakeholder: Civic Tech Jobsstakeholder: Civic Tech Jobss: VRMSstakeholder: VRMSstakeholder: VRMSsize: 0.25ptCan be done in 1.5 hours or lessCan be done in 1.5 hours or less
Type
Projects
Status
🆕New Issue Review