hackforla / peopledepot

A project to setup a datastore for people and projects at HackforLA. The link below takes you to the code documentation
https://hackforla.github.io/peopledepot/
GNU General Public License v2.0
5 stars 26 forks source link

Create Table: project_url #41

Open Neecolaa opened 2 years ago

Neecolaa commented 2 years ago

Dependencies

We need to create the project_url 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

Resources/Instructions

Description

Collection of URLs for a project by url type

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)

    • [x] (PK) id - int - Record Id
    • [x] (FK) project_id - int - Record Id
    • [x] (FK) url_type_id - int - Record Id
    • [x] name - CharField(max_length=255)
    • [x] external_id - CharField(max_length=255)
    • [x] url - url varchar
  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)

    • [x] project (many-to-one)
    • [x] url_type (many-to-one)
  2. In ERD only (having items here indicates a mismatch, which requires a review)

    • None
joshuayhwu commented 1 year ago

class Project_URL(AbstractBaseModel):
    """
    project_url
    """
    id = models.IntegerField(primary_key=True)
    project_Id = models.ForeignKey(Project, on_delete=models.CASCADE)
    url_type_id = models.ForeignKey(Project, on_delete=models.CASCADE)
    url = models.URLField(blank=True) 

    def __str__(self): 
        return f"{self.name}" 
fyliu commented 1 year ago

This is better done after #77 since it references that table.

Neecolaa commented 9 months ago