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 project status 46 #449

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dmartin4820
Copy link
Member

Fixes #46

What changes did you make?

  • created project_status model
  • register project_status in admin
  • add project_status endpoints
  • add project_status seed data

Why did you make the changes (we will use this info to test)?

N/A

Copy link
Member

@del9ra del9ra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Denzel,
Thank you for working on this! I tested it, and everything worked well on my end. I just have a couple of questions:

  1. Why are the descriptions on the 5th and 6th lines in quotation marks in the app/core/initial_data/PD_Table and Field Explanations - ProjectStatus - Data.csv file? Do you think this has an impact on how the code works?
  2. Shouldn't the uuid field be mentioned in the _seed.py file?

@dmartin4820
Copy link
Member Author

dmartin4820 commented Jan 9, 2025

Hi Denzel, Thank you for working on this! I tested it, and everything worked well on my end. I just have a couple of questions:

1. Why are the descriptions on the 5th and 6th lines in quotation marks in the app/core/initial_data/PD_Table and Field Explanations - ProjectStatus - Data.csv file? Do you think this has an impact on how the code works?

2. Shouldn't the uuid field be mentioned in the _seed.py file?

Hey Del, thanks for the comments.

  1. I'm unsure how that got that way. The excel sheet doesn't have the quotes. I'll change that.
  2. Good point. All the other seed files have UUID, but the table in the Google sheet, for this PR, didn't have an UUID column. @Neecolaa @fyliu Can we make an update to the Project Status table in Google sheets so that it contains an id column? By doing this we would maintain consistency with the other tables and seed data with UUID fields.

@fyliu
Copy link
Member

fyliu commented Feb 6, 2025

  1. Good point. All the other seed files have UUID, but the table in the Google sheet, for this PR, didn't have an UUID column. @Neecolaa @fyliu Can we make an update to the Project Status table in Google sheets so that it contains an id column? By doing this we would maintain consistency with the other tables and seed data with UUID fields.

I guess it depends on if we still need it set to specific values. The values it's being set to in the spreadsheet aren't really UUID values.

Originally, I let the database generate the ID/UUID values since it's an auto-generated field and the initial data sheets didn't have the values. Then @ethanstrominger said he needed to set the values for testing purposes, so we did that for some of the tables. But I don't think it's being used in tests right now?

We should bring this up at the meeting and ask if we still need to set this.

Copy link
Member

@del9ra del9ra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dmartin4820 ,
Thanks for your contribution! Nice work on this, it looks great to me!

Copy link
Member

@fyliu fyliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I looked at this more closely and found a couple more things to improve.

@@ -137,7 +149,9 @@ class Project(AbstractBaseModel):
"Authorization: token [gh_PAT]" \
https://api.github.com/repos/[org]/[repo]',
)
# current_status_id = models.ForeignKey("status", on_delete=models.PROTECT)
current_status_id = models.ForeignKey(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be current_status.

The old code was written before we realized Django convention is to drop the _id ending for foreign key relations.

Comment on lines 5 to 6
Closed,Closed, possibly not completed (usually does not show up on the website). Unlikely to be reopened.
Deleted,Holds for 90 days before final removal (used for test project entries, or mistakes that do not need to be remembered)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, can you add back the double quotes?

I think the double quotes are actually necessary for the convert.py script to work. They're likely added by google to help any csv parser read it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back. It was definitely needed otherwise the csv parser would not run.

@dmartin4820 dmartin4820 force-pushed the create_table_project_status_46 branch from b940f36 to 586dd86 Compare February 27, 2025 06:29
@dmartin4820 dmartin4820 requested a review from fyliu February 27, 2025 06:30
Copy link
Member

@fyliu fyliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. They look great!

I'm sorry, I just noticed another little thing.

The admin site adds an "s" at the end when displaying the plural form of the model. It doesn't know to use "project statuses".
2025-02-27 15 26 00 localhost 6b88d8307465

In models.py you can search for "verbose_name_plural" and use that as an example to add the plural for it. I think you should make it all lowercase and let Django deal with the capitalization. I see the existing code is doing something different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR changes requested
Development

Successfully merging this pull request may close these issues.

Create Table: project_status (used to say project_program_area_status)
3 participants