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

Create Table: win #82

Open
14 of 20 tasks
fyliu opened this issue Sep 12, 2022 · 3 comments
Open
14 of 20 tasks

Create Table: win #82

fyliu opened this issue Sep 12, 2022 · 3 comments
Labels
complexity: missing dependency Issue has dependencies feature: table creation needs FK text see issue #150 for explanation, temporary label delete when done p-feature: wins PII: TRUE Table or function has or uses Personally Identifiable Information (PII) role: back end s: hackforla.org stakeholder: hackforla.org website s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours

Comments

@fyliu
Copy link
Member

fyliu commented Sep 12, 2022

Dependency

Overview

We need to create the win table so that we can update a shared data store across hackforla.org, vrms, civictechjobs, and tables (onboarding) project.

Details

A table and a model are the same thing

Action Items

  • identify and document table description (see spreadsheet under Resources)
    • if not, reach out to PD leads
  • compare and check off the data fields (below) against the ERD. Note any fields in the ERD that's missing from the list. (see Resources)
  • compare the check off associated tables (below) against the ERD. Note any associated tables in the ERD that's missing from the list (see Resources)
  • create a single model in Django (defining schema)
  • write a test for the relationships this model will have with other models (e.g., creating a user and assigning them a set of permissions on a project).
  • write an API end point
  • write API unit tests
  • document the endpoint

Resources/Instructions

Description

Connects a win to a user

Data Fields

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)

    • (PK) id - int - Record Id
    • (FK) user_id - int - Record Id
    • practice_areas - int[] (practice_area id)
    • teams - int[] (projectID)
    • description - varchar
    • (FK) win_type_id - int
    • can_use_photo - boolean
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • None

Associated Tables

  1. Copied from spreadsheet and checked off according to ERD. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)

    • win_type (many-to-one)
    • user (many-to-one)
    • practice_area (many-to-many array of ids)
    • project (many-to-many array of ids)
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • None
@fyliu fyliu added this to the All tables added milestone Sep 25, 2022
@joshuayhwu
Copy link

class Win(AbstractBaseModel):
	"""
	win
	"""
	id = models.IntegerField(primary_key=True)
	user_int = models.ForeignKey(User, on_delete=models.CASCADE)
	roles = models.ForeignKey(Role, on_delete=models.CASCADE)
	teams = models.ForeignKey(Project, User, on_delete=models.CASCADE)
	description = models.CharField(max_length=255)
	accomplishment_type = models.ForeignKey(Accomplishment, on_delete=models.CASCADE)
	can_use_photo = models.BooleanField()

	def __str__(self): 
		return f"{self.name}" 

@ExperimentsInHonesty ExperimentsInHonesty added p-feature: wins s: VRMS stakeholder: VRMS s: hackforla.org stakeholder: hackforla.org website labels Mar 5, 2023
@ExperimentsInHonesty ExperimentsInHonesty added the PII: TRUE Table or function has or uses Personally Identifiable Information (PII) label May 4, 2023
@Neecolaa Neecolaa added the feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet label Jul 8, 2023
@Neecolaa

This comment was marked as resolved.

@Neecolaa

This comment was marked as resolved.

@Neecolaa Neecolaa removed the feature: ERD/SS adjustment Requires adjustments to be made to the ERD & Spreadsheet label Jan 18, 2024
@shmonks shmonks moved this to Ice Box in P: PD: Project Board Jun 7, 2024
@shmonks shmonks added the dependency Issue has dependencies label Sep 20, 2024
@ExperimentsInHonesty ExperimentsInHonesty added the needs FK text see issue #150 for explanation, temporary label delete when done label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: missing dependency Issue has dependencies feature: table creation needs FK text see issue #150 for explanation, temporary label delete when done p-feature: wins PII: TRUE Table or function has or uses Personally Identifiable Information (PII) role: back end s: hackforla.org stakeholder: hackforla.org website s: VRMS stakeholder: VRMS size: 2pt Can be done in 7-12 hours
Projects
Status: 🧊Ice Box
Development

No branches or pull requests

5 participants