-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 program area xref 45 #398
Create table project program area xref 45 #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues from my review. Good catch on not including the "through" field when there aren't extra fields required on the "join table" between project and program area. I'm going to update PR #385 to reflect that modification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.Progress: I implemented changes similar to those in Denzal’s PR regarding the ManyToMany relationship. Fang left a comment saying the API test issue needs to be discussed today. |
- compose file no longer uses versioning - Dockerfile env vars use = signs
CONTRIBUTING.md will be a simplified page that links to the mkdocs contributing page.
These can be auto-generated if needed
* Adding complexity label * Adding missing labels * Adding labels to new issue templates * Add missing labels to new issue template * Add missing labels to new issue templates * Add missing labels to new issue template * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Add missing labels to new issue templates * Apply suggestions from code review I added and removed some labels --------- Co-authored-by: Bonnie Wolfe <[email protected]>
@del9ra is working on updating the commits to the latest upstream/main. The most prominent problem I'm seeing is the through or xref model fields that are foreign keys should be named something like "project" rather than "project_id". I think we're missing documentation on this and other "how to translate database table/design into Django model" information. I think we'll have to decide on where to put this and add to it when we realize what's missing. Maybe something like |
I’ll make this adjustment. However, the fields are named project_id and program_area_id in the Lucidchart diagram and the Google Sheet, so I was following the existing documentation. |
@del9ra Sorry about the differences. It's a difference in conventions between the database and Django. It's customary to append the "_id" to column names to remind the reader it's a foreign key. It helps when typing out SQL queries to compare things like "publisher.id = publisher_id" when joining "book" and "publisher" tables. In Django, the convention is to drop the "_id" portion when implementing a foreign key column. But even though the Book.publisher ForeignKey field doesn't end with "_id", the underlying database column it writes to will still be "publisher_id". I used an older Django version in the past where it would name the db column "publisher_id_id" if I kept the "_id" in the field name, but Django 4 will name it correctly with either way. But removing the "_id" in Django also makes the code more readable. def test_project_program_area_relationship(project):
...
workforce_development_program_area_xref = ProjectProgramAreaXref.objects.get(
project_id=project, program_area_id=workforce_development_program_area
)
...
So even though Django is smart enough to detect the extra "_id" now, other parts of the system still prefers removing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@del9ra this PR is not reviewable right now because the files changed tab shows a lot of extra changes that are not part of it. It's hard to see what the actual changes are.
I can try to clean them up or you can do it if you prefer.
@del9ra sorry I didn't realize you made a new PR. I'll look at that instead. You should close this PR so it's clear which one you want reviewed. Thanks! |
Closing this PR because I couldn’t resolve the issue on this branch. I created a new branch and a new PR, where I was able to resolve the merge conflicts. #431 |
Fixes #45
What changes did you make?
Why did you make the changes (we will use this info to test)?