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 user status type 35 #427

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

del9ra
Copy link
Member

@del9ra del9ra commented Oct 28, 2024

Fixes #35

What changes did you make?

  • created a model
  • added seed data
  • tested API endpoints and model

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

  • to update a shared data store across hackforla.org, vrms, civictechjobs, and tables project

Copy link
Member

@dmartin4820 dmartin4820 left a comment

Choose a reason for hiding this comment

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

Left some minor comments. I switched to your branch in my local peopledepot git area, and I ran

1. ./scripts/buildrun.sh
2. ./scripts/test.sh

without issue.

Other than the few comments, it looks good to me 👍 .



@admin.register(UserStatusType)
class UserStatusType(admin.ModelAdmin):
Copy link
Member

Choose a reason for hiding this comment

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

The class name should end with "Admin" as shown in the docs here.

@@ -426,3 +426,11 @@ class SocMajor(AbstractBaseModel):

def __str__(self):
return self.title


class UserStatusType(AbstractBaseModel):
Copy link
Member

Choose a reason for hiding this comment

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

Now that this model is going to be implemented, we should uncomment the one-to-many relationship here, according to the tool tip under here.

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.

Great work!
I just have a couple of small things.

@@ -11,6 +11,7 @@

USER_PERMISSIONS_URL = reverse("user-permission-list")
ME_URL = reverse("my_profile")
USER_STATUS_TYPE_URL = reverse("user-status-type-list")
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 USER_STATUS_TYPES_URL since it's the url for the list, which contains multiple models.

I see there's many of these lines that got through the PR process with the singular names. Will have to make an issue to to correct those.

]
for uuid, name, description in items:
UserStatusType.objects.create(uuid=uuid, name=name, description=description)
pass
Copy link
Member

Choose a reason for hiding this comment

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

The pass is a no-op (no operation) and should be removed. I think it's from the template.

Copy link
Member

Choose a reason for hiding this comment

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

I realize there's only 1 migration in the original PR and it's definitely the right thing to do to add new commits in response to PR change requests.

Now that there's 3 migrations, you should add another commit to merge them into one. Here's a guide that's meant to help in this case. It's still in an issue right now. Maybe you can add some feedback/suggestion comment to it if you try it.

Copy link
Member

@dmartin4820 dmartin4820 left a comment

Choose a reason for hiding this comment

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

No other changes from me. Tested buildrun and test scripts with no issues as well. Good work.

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.

This looks great! Thank you for adding the user status type model!

@fyliu fyliu force-pushed the create-table-user-status-type-35 branch from a60e248 to 5033fb7 Compare November 13, 2024 18:24
@fyliu fyliu force-pushed the create-table-user-status-type-35 branch from 5033fb7 to 8225c29 Compare November 13, 2024 20:50
@fyliu
Copy link
Member

fyliu commented Nov 13, 2024

I decided to squash the commits before merging because there's migrations that's replaced in later commits. Squashing them removes those intermediate files from history so that rolling forward from any past commit would work.

@fyliu fyliu merged commit e3441c8 into hackforla:main Nov 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅Done
Development

Successfully merging this pull request may close these issues.

Create Table: user_status_type
4 participants