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

Add new ExtendedChoiceField and map ai_is_trustworthy "Yes"/"No" values to "CD" #12976

Closed
wants to merge 7 commits into from

Conversation

danielfmiranda
Copy link
Collaborator

@danielfmiranda danielfmiranda commented Oct 7, 2024

Description

This PR introduces a new ExtendedChoiceField model, offering users the following selection of options:

  • Good
  • Average
  • Needs Improvement
  • Bad
  • Not Applicable
  • Can’t Determine

The ai_is_untrustworthy field in the GeneralProductPage model has been updated to use this new set of choices.

Additionally, this PR includes a migration operation that iterates through all GeneralProductPage instances where ai_is_untrustworthy is currently set to Yes or No, and updates those values to Can’t Determine (CD) to align with the new choices.

┆Issue is synchronized with this Jira Story

@danielfmiranda danielfmiranda temporarily deployed to foundation-s-pni-field--2sibfr October 8, 2024 01:53 Inactive
@@ -15,8 +15,16 @@ def yes_no(value):


@register.filter
def extended_yes_no(value):
"""Converts quad-state to human readable string"""
def extended_choice(value):
Copy link
Collaborator Author

@danielfmiranda danielfmiranda Oct 8, 2024

Choose a reason for hiding this comment

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

Updated this existing tag instead of creating a new one, because almost all of the GeneralProductPage's fields use the template "product_criterion_primary_info.html", which uses this tag, to render its selection.

@danielfmiranda danielfmiranda temporarily deployed to foundation-s-pni-field--2sibfr October 8, 2024 05:57 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-pni-field--2sibfr October 8, 2024 18:03 Inactive
@danielfmiranda danielfmiranda temporarily deployed to foundation-s-pni-field--2sibfr October 8, 2024 19:12 Inactive
@danielfmiranda danielfmiranda removed the request for review from mmmavis October 8, 2024 19:18
@danielfmiranda
Copy link
Collaborator Author

danielfmiranda commented Oct 8, 2024

Closing in favor of: #12979

@danielfmiranda danielfmiranda temporarily deployed to foundation-s-pni-trustw-eoreu3 October 8, 2024 19:24 Inactive
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.

1 participant