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

Package field update method #222

Merged
merged 8 commits into from
Nov 22, 2023
Merged

Package field update method #222

merged 8 commits into from
Nov 22, 2023

Conversation

JonoYang
Copy link
Member

This PR adds a new method to the Package model to update fields. The idea is that we use these methods to update package fields, where it also updates the history as well.

@JonoYang JonoYang force-pushed the package-field-update-method branch 2 times, most recently from 6937b44 to db673ea Compare November 17, 2023 00:39
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

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

Thanks @JonoYang
I was wondering, do we really need both update_field and update_fields? Isn't update_fields sufficient?

packagedb/tests/test_models.py Outdated Show resolved Hide resolved
@JonoYang
Copy link
Member Author

@keshav-space That's true. I have the two because I wasn't sure what the best way to have the method arguments for updating a single field or multiple fields. I've removed update_field and _update_field and just left update_fields.

Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
    * Update test expectations

Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
    * Remove _update_field and update_field

Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang JonoYang merged commit 4d598b2 into main Nov 22, 2023
9 checks passed
@JonoYang JonoYang deleted the package-field-update-method branch November 22, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants